CSE Cheat sheet
Ronit Khanna
relationship between development effort and maintenance effort?
Small increase in dev can reduce maintenance.
build-and-fix approach to software development
writing a program and modify it until it is functional, without regard to system design
What is the main problem with the water fall model?
It doesn’t allow much reflection or revision.
What is a code walk through?
A meeting in which several people carefully review a design/ sections of code to see if the design satisfies requirement or the
implementation represent the design.
How is white-box testing different from black-box testing?
Black box testing is a software testing methodology in which the tester analyzes the functionality of an application
without a thorough knowledge of its internal design. Conversely, in white box testing, the tester is knowledgeable
of the internal design of the application and analyzes it during testing.
Throw-away Prototypes
• A “quick and dirty” prototype to test an idea or a concept is called a throw-away prototype
• Throw-away prototypes should not be incorporated into final systems
Evolutionary Prototypes
• Because it is designed more carefully, an evolutionary prototype can be incorporated into the final system
• Evolutionary prototypes provide a double benefit, but at a higher cost
Prototypes
• A prototype is a program created to explore a particular concept
• Prototyping is more useful, time-effective, and cost-effective than merely acting on an assumption that later may backfire
• Usually a prototype is created to communicate to the client:
– a particular task. – the feasibility of a requirement. – a user interface
Evolutionary Development Model
• Evolutionary development divides the design process into – architectural design - primary classes and interaction. – detailed design -
specific classes, methods, and algorithms
• Each refinement cycle focuses on one aspect of the system
• As each refinement cycle is addressed, the system evolves
Software Engineering
An attempt to produce a repeatable process for the development and management of software projects. The quality of the
software is a direct result of the process we follow to create it.
Which development method takes an object-oriented approach? Briefly describe
this methods’ steps.
Evolutionary Development
Establish Requirements – What are the inputs expected by the application and what outputs are to be returned.
Architectural Design – Decide what kind of Algorithms and Data Structures are needed to store and access the data, and how are the
objects going to interact.
Establish Refinement Scope – Phases of development
Identify Classes & Objects , Identify Relationships ,Detailed Design ,Implementation ,Unit Testing ,System Test Release
A very bad method for programming is called the Build-and-Fix approach. Why is this such a bad method?
The Build-and-Fix approach is bad because no specifications are ever established which leads to piecemeal code. Only immediate
problems are corrected larger architectural problems are never identified or fixed. Leads to an inability to maintain an application.
What is a code walkthrough?
A meeting in which several people carefully review a design/ sections of code to see if the design satisfies requirement or the
implementation represent the design.
What are four distinct characteristics of an object-oriented language?
Polymorphism – The word ‘polymorphism’ literally means ‘a state of having many shapes’ or ‘the capacity to take on different forms’.
When applied to object oriented programming languages like Java, it describes a language’s ability to process objects of various types
and classes through a single, uniform interface. Polymorphism in Java has two types: Compile time polymorphism (static binding) and
Runtime polymorphism (dynamic binding). Method overloading is an example of static
polymorphism, while method overriding is an example of dynamic polymorphism.
Inheritance – Borrowing traits from other classes
Encapsulation – Is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit. ...
ex - Declaring the variables of a class as private. Provide public setter and getter methods to modify and view the variables values
Abstraction – Black Box all you need to know is what to put in and what you’re going
to get out.
Accessor – accesses private variable in class. Mutator- modifies private variable in class.
Constructor – special method used to create new objects
Define a variable fmt that formats a decimal
DecimalFormat fmt = new DecimalFormat("0.00#");
Association – When object of one class is local variable in method of another class.(UML – diamond
shape)
Inheritance – When a class inherits all the variables and methods from another class.(UML – Triangle
shape)
HOW IS DATA GIVEN TO ITS PARAMETER – command line interface
Numbers.remove(2);
numbers.set(2);numbers.size();
If(numbers.isEmpty()); number.clear();
int[] numbers = {0, 1, 2, 3};
Array List<Integer> numbers =
new ArrayList<Integer>( );
numbers.add(4);numbers.add(3);
(Integer)numbers.get(0);
CSE Cheat sheet
Ronit Khanna
Overloading – ->Deals with multiple methods with same name and same class but diff signatures.->Lets
you define a similar operation in different ways for different parameters.
Overriding-
->Deals with multiple methods with same name and signatures but one in parent and other in child
class.
->Lets you define a similar operation in diff ways for diff object types.
->polymorphism is achieved by overriding.
Methods defined under OBJECT CLASS: toString() – gives readable representation of object, equals() and
clone().
Local variable - variables declared in a method. They are used only in that method.
Instance Variable - variables declared at a class level. They are used by all methods in that class.
What is an abstract class and abstract method? Give an example of an abstract method definition.
An abstract class cannot be instantiated and contains abstract methods (as well as possibly, non-abstract methods). An abstract
method is a method header without a method body. This is used for inheritance purposes. A child class can then fill in the method body
of the parent's abstract method. Example:
public abstract void exampleMethod( );
visibility modifiers – public: can be accessed from anywhere. ||private: can only be accessed from inside the class
protected: the member can only be accessed within its own package (as with package-private) and, in addition, by a subclass of its
class in another package.
From Quizes;
The relationship between a class and an object is best described as -- objects are instances of classes
Inheritance through an extended (derived) class supports which of the following concepts? – code reuse
During program development, software requirements specify - what the task is that the program must perform
Of the various phases in software development, which of the following is usually the lengthiest? – maintenance
If a class is declared to be abstract then some methods in the class may have their bodies omitted
In order to determine the type that a polymorphic variable refers to, the decision is made- the Java run-time environment
at run time
A variable declared to be of one class can later reference an extended class of that class. This variable is known as-
polymorphic
You cannot instantiate an object from Abstract ones. But you can extend Abstract classes as well as
Interfaces.
new Student s1 = ("Jane Doe", "Computer Science", 3.333, 33);
public int findName(String title, String first, String middle, String last)
{
for (int j=0; j<n; j++)
if (title.equals(addressBook[j].getTitle( ) &&
first.equals(addressBook[j].getFirst( ) &&
middle.equals(addressBook[j].getMiddle( ) &&
last.equals(addressBook[j].getLast( ))
return j;
return –1;
1 one and only one
• 0..1 zero or one
• M..N from M to N (natural numbers)
• * from zero to any positive integers
• 0..* from zero to any positive integers
• 1..* from one to any positive integers
int[] numbers = {0, 1, 2, 3};
Array List<Integer> numbers =
new ArrayList<Integer>( );
numbers.add(4);numbers.add(3);
(Integer)numbers.get(0);