Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CSE 464: Software QA and Testing

Assignment #2

All assignments in this course are to be digitally produced, and submitted to the canvas as a PDF file. The grading of the assignments is also to be done over the canvas by the TA, with TA’s comments also made available on the canvas.

1.   What is the process of object-oriented analysis? How can we derive domain models for a software system? (10 points)

2.   What are the problems of the following code for data model and observers when a new observer is  to be added? What kinds of design patterns may be used to improve it? Can you provide the code to add a new observer like LineChartView? (20 points)

class TableView {

void update (double [] values) {

System.out.print("Table[");

for (double v : values

) {

System.out.print(v + ", ");

}

System.out.println("]");

}

}

class BarChartView {

void update (double [] values) {

System.out.print("Bar[");

for (double v : values

) {

System.out.print(v + ", ");

}

System.out.println("]");

}

}

 

public class DataModel {

private double [] values = new

double []{0.1, 0.4, 0.3, 0.2};

private TableView table;

private BarChartView barchart;

public void attachTable (TableView t) {

table = t;

}

public void attachBarchart (BarChartView b)

{

barchart = b;

}

 

public void notify (double [] newvalues) {

values = newvalues;

table.update(values);

barchart.update(values);

}

}

3.   Can you provide the code to show how template method pattern and strategy pattern implement the paint methods for buttons and list views? Your implementation may simply ask the button to print  out drawing button border” for border, and similarly for button component and button children.     Below is the code for the paint method. The class Graphics can have the painting methods               (paintComponent, paintBorder, paintChildren) (20 points)

public void paint(Graphics g) {

paintComponent(g);

paintBorder(g);

paintChildren(g);

}

4.   What is refactoring? (5 points) Can you explain what is Extract Method and why and how we want to do it? (5 points)

5.   What is pair programming? (5 points) Can you explain how pair programming of Peer A and Peer B

can be used to collaborate on writing code and tests (both peers must write code and tests), assuming at any moment only one peer has the control of the keyboard? You explanation must    include example steps and clearly specify the actions performed by Peer A and Peer B during the whole process (10 points)

6.   Please read this control flow graph and convert it back to code. (15 points). Please specify all the definitions and all the uses (including variable names). (10 points). For the last statement “out = x + y + z”, can the definition “z = 20” at the beginning reach this last statement without being redefined? If so, how? (5 points)

 

7.   What is Test-Driven Development? (5 points) Can you explain how it works? (5 points)

8.   How scrum manage project schedule into sprints? (5 points) What are the activities performed in a sprint? (5 points)