Development > Software, Programming >
Notes ∞
-
It's not a test case if it touches the: disk, network, database
- Terms
- Acceptance Testing
- Behavior Driven Development (BDD)
- Behaviour-Driven Development (BDD)
- Test All The Fucking Time (TAFT)
- Stub - Just returns a value
-
Mock - More interactive than a stub. It actually cares about the parameters passed to it, how many times it's called, etc.
Qualities ∞
Technical:
-
Isolated from the outside world
- Doesn't talk to the database, communicate across the network, touch the file system or do special things to the environment
- It is written gray-box, i.e. it reads as if it were black-box, but sometimes takes advantage of white-box knowledge. (Typically a critical factor in avoiding combinatoric issues.)
-
Isolated from other tests
- Unaffected by the presence, absence, or results of other tests. No dependencies. Self-contained.
- Order Independent and Isolated - it should be possible to run the tests in whatever order the test runner chooses.
- be able to run at the same time as other unit tests, even concurrently with itself
- It does not test the object inside the running app, but instead in a purpose-built testing application.
-
Repeatable in every aspect
- Test your boundary conditions and Always keep your tests passing at 100%.
Social / Convenience:
- Simplifies design and improves productivity. Improvements in code quality and a reduction in bugs are an important side effect.
- Intention-revealing - the best unit tests make it clear to the reader how an objects API is intended to be used.
-
Easy to Setup
- Short, typically under a dozen lines of code.
- It invokes only a tiny portion of the code, most usually a single branch of a single function.
- Quick and easy to write
- It is generally written before the code-change it is meant to test.
- Maintainable
-
Fast to run/complete
- As above, it's short and invokes a tiny portion of the code.
- Unique (providing confidence not provided by other tests/uncorrelated with other tests)
- Automated
- Readable
-
Trustworthy
- Coded to the same standard as shipping code, i.e. the team's best current understanding of coding excellence.
-
Promotes code commits: In combination with all other microtests of an app, it serves as a 'gateway-to-commit'. That is, a developer is encouraged to commit anytime all microtests run green, and discouraged (strongly, even nastily) to commit otherwise.
I have no idea what that means:
-
It avoids most or all usage of 'awkward' collaborators via a variety of slip-and-fake techniques.
Reading ∞
- Don't Become the Quality Police
- What are the Qualities of a Good Test? by Mark Levison on Oct 03, 2008
-
- The GNU/Linux Desktop (GUI Application) Testing Project (GNU LDTP) aims to produce a high quality test automation framework with cutting-edge tools that can be used to test and improve the GNU/Linux or Solaris desktops. It uses the Accessibility libraries to discover through the application's user interface. The framework also has tools to record test-cases based on user actions in an application.
Last updated 2020-05-19 at 16:13:08
ported