Testing Flashcards
What is software reliability?
Probability that a software system will not cause failure under specified conditions.
Measured by uptime, MTTF (mean time till failure), crash data.
How many bugs are estimated to be in complex software systems?
10-50 bugs per 1000 lines of code.
What is testing in software development?
A systematic attempt to reveal errors.
What does a failed test indicate?
An error was demonstrated.
What does a passed test indicate?
No error was found (for this particular situation).
What are unit tests?
Tests that should be non-interactive and made up of a huge number of statements that exercise some code and compare the computed result with the expected result.
What is the purpose of a test driver?
To report the number of successes and number of failures when finished.
What is the benefit of a comprehensive unit test suite?
Allows you to refactor your code with confidence.
What do unit tests typically contain?
Assertions about the behaviour of your software.
What is a JUnit test class?
A class created to test another class, containing various ‘test case’ methods to run.
What does the @Test annotation signify in JUnit?
Marks a method as a JUnit test case.
What does assertTrue(test) do?
Fails if the boolean test is false.
What does assertFalse(test) do?
Fails if the boolean test is true.
What does assertEquals(expected, actual) do?
Fails if the values are not equal.
What does assertNotNull(value) check?
Fails if the given value is null.
What is regression testing?
Re-executing prior unit tests after a change to ensure old fixed bugs are still fixed.
What is Test-Driven Development (TDD)?
A process that starts with designing and developing tests for every small functionality of an application before writing the code.
What is the TDD cycle?
Write a test, make it run, change code to make it right (refactor), repeat process.
What is the importance of naming test cases descriptively?
Clear, long, descriptive names help identify what the test is checking.
What are breakpoints in debugging?
Lines of code where you want to ‘pause’ the execution of a program.
What does the continue feature do in debugging?
Continues the execution of the program until the next breakpoint or until the program terminates.
What is a call stack?
Allows you to see the current stack of method calls.
What is the purpose of the watches window in debugging?
Allows you to ‘watch’ the value of a variable.
Fill in the blank: A bug can be ______ or can hide in your code until much later.
visible