Exam 1 with edits

Exam 1
Software quality and testing


1. Define each of:

Software fault: static error in the code.
Software error: internal, not a normal behavior of the program due to a fault.
Software failure: external, visible failure of the program. That it doesn't work basically.

2. List 5 levels of test process maturity. 

Level 0: Testing and debugging are the same. (Worst level)
Level 1: Testing is only to find that your code doesn't work.
Level 2: Get defensive or make an issue personal with testers because they broke your code.
Level 3: Understand the job of a tester and take feedback as constructive criticism.
Level 4: Become an expert software tester and make extreme good quality software. Work in harmony with testers.

3. Explain difference between revenue tasks and excise tasks.

Revenue tasks contribute directly to the solution of a problem, and excise tasks do not.
Excise tasks are candidates for automation, revenue tasks are not.

4. Authors, History of Unit.

Kent Beck, Erich Gamma, David Saff and Kris Vasudevan where the developers who created JUnit.
The story goes that it was largely written on an airline flight that Gamma and Beck took together in 1997 from Zurich to the 1997 OOPSLA in Atlanta.

5. Why do testers automate tests? Are there limits to automation? and what are they.

To make testing lot easier and fast. Sometimes you have 300 tests to run and not enough head count so the answer is to let automated tests do the work in some extent. 
Limits in automation: not reliable, even though you have and automated test you still need to put in extra work or very the result case.

6. Explain how the class inheritance hierarchy can affect controllability and observability.

Observability: observe the behavior of the program given inputs, test case variables or components.
Controllability: How easy it is to provide a program inputs in order to ace a test or simply see an expected behavior.
Inheritance: pass down to other subclases or children classes the ability to use the parents variables and methods.
Inheritance limits controllability because you're dealing with interconnected clases (a hierarchy) and this makes controllability difficult.

7. Explain what "test && commit.. revert " is and the problems you see for it.

TCR is Kent Beck's "method" that is somewhat like TDD but its more friendly to a programmers confidence.
It's basically to make small changes to a code in order to always keep in green your test case. That way you can revert small pieces of code that don't work without breaking it. 
As i've mentioned before on this blog, i don't really see a problem with TCR.  On the contrary, i see more problems with TDD.
I think that TCR is giving you calmness while programming because you don't have the stress of modifying your code and not being able to remember the way it was before you messed it up, you can simply revert the changes.

8.  Explain what is wrong with the code above. Describe the fault precisely.

I think that the i > 0 is wrong because there will be a moment in which you'll have to read x[0] and the for won't work because 0 > 0 cero is not grater than cero it's equal.

9. If possible give a test case that doesn't execute the fault. If not briefly explain why.

To not execute the for. The null value for x will result in a NullPointerException before the loop test is evaluated, hence no execution of the fault.
Input:
x = null; y = 3
Expected Output: NullPointerException
Actual Output: NullPointerException

10 & 11. If possible, give a test case that executes the fault but does not result in an error state.

****Extra point.
For any input where y appears in a position that is not position 0, there is no error. Also, if x is empty, there is no error.
Input: x = [2,3,5]; y = 3;
Expected Output: 1
Actual Output: 1

12.  If possible give a test case that results in an error state, but not a failure.

For an input where y is not in x, the missing path (i.e. an incorrect PC on the final loop that is not taken, normally i = 2, 1, 0, but this one has only i = 2, 1, ) is an error, but there is no failure.
Input: x = [2,3,5]; y = 7;
Expected Output: -1
Actual Output: -1

13. For the given test case, describe the first error state. Describe the complete state.

Error state: 0 > 0 comparison error.
Input: x = [2,3,5]; y = 2;
Expected Output: 0
Actual Output: -1
First Error State:
x = [2,3,5]
y = 2;
i = 0 (or undefined);– PC = return -1;

Comments

Popular posts from this blog

Chapters 6.1 & 6.2

Final Exam Questions

Course evaluation