Open main menu

CDOT Wiki β

Changes

BigBlueButton Mobile Client Unit Tests

277 bytes added, 16:29, 10 November 2014
How many unit tests should a function get?
*Don't test the language or the framework. If you are using a framework or library for your application, and the documentation tells you what the behavior of a function or class is, don't test it. If it fails to do what it is supposed to, this is a bug in the framework, library, or language implementation, but not your application.
*Don't test simple getters and setters. By "simple setter", I mean a method that accept a single argument, and simply sets the value of a field to the value of that argument. By "simple getter", I mean a method that accepts no arguments, and simply returns a value of a field.
*Each control structure (branching, looping, jumping/breaking, returning from a function) adds one more unit test to the function.
*Each special case deserves a unit test (maybe you want your function to return null in some cases, or throw an exception in response to an argument having a specific value). Generally, each way your function can possibly be ended, adds one more unit test to that function.