Question
During software change process the programmer have already done refactoring during prefactoring phase, why is postfactoring needed? What is the difference between inspection and testing?
During software change process the programmer have already done refactoring during prefactoring phase, why is postfactoring needed?
What is the difference between inspection and testing? Give an example of a bug that is hard to find by inspection?
What is regression testing? What does regression testing prevent?
Explain the difference between dependency and coordination in a class interaction diagram graph with c++ code example for each?
If you have a code to incorporate your code changes through polymorphism or through a component class which one are you going to choose and why?
Give three examples of refactoring, when should each of them be applied and why are they important?
Associate the following types of refactoring with the prefactoring and postfactoring , justify each decision.
- Move function from one class to another.
- Extract superclass.
- Extract component class.
- Merge classes.
From the following function printposition(), extract a new function that returns the position of the beginning of a given string in a given text. You also have to give the revised printPostion().
Void printpostion()
{
Int i,j;
Char* text = 1234567890;
Int text_length = 10;
Char* array_to_search1 = 23;
Int array_to_search1_length = 2;
Int position1 = -1;
For (i=0; i< text_length array_to_search1_length+ 1; i++){
Bool found =true;
For (j=0 ; j< array_to_search1_length; j ++){
If (text [i+j] != array_to_search1[j]){
Found =false;
Break;
}
}
If (found){
Position1 = i;
Break;
}
}
Count < }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started