Thomas WICKHAM
@mackwic
RustFest 2017
Zurich
@mackwic
@mackwic
mackwic@gmail.com
PARIS - RABAT - LAUSANNE - SAO PAULO - SYDNEY
if you need to argue with your boss...
#[test]
fn it_exists() {
Divisor::divide()
}
error[E0599]: no function or associated item named `divide` found for type `Divisor` in the current scope
impl Divisor {
fn divide() {}
}
running 1 test test it_exists ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
#[test]
fn it_err_when_zero_is_given() {
// arrange
// act
let res = Divisor::divide(12, 0); // division by 0
// assert
assert!(res.is_err())
}
impl Divisor {
fn divide(numerator: u32, denominator: u32)
-> Result<(), ()> {
Err(())
}
}
Unit tests in `_test` modules
Integration tests in `tests/` directory
Functional tests in `examples/` directory
and Documentation exemples
mod task {
pub use parser::task::*;
mod resolve_include {
pub use super::*;
#[test]
fn it_exists() {...}
#[test]
fn it_returns_a_full_path() {...}
#[test]
fn include_is_an_error_when_reading_from_stdin() {...}
}
mod has_name {...}
mod is_templated {...}
}
mod task {
pub use parser::task::*;
mod resolve_include {
pub use super::*;
#[test]
fn it_exists() {...}
#[test]
fn it_returns_a_full_path() {...}
#[test]
fn include_is_an_error_when_reading_from_stdin() {...}
}
mod has_name {...}
mod is_templated {...}
}
LAUSANNE:
ch-info@octo.com (or jglorieux@octo.com)
PARIS:
recrutement@octo.com
(or twickham@octo.com)
About the ROI of TDD —https://pdfs.semanticscholar.org/65d9/24ef1162b2f3c24bd15d627302887991b298.pdf
http://robertvbinder.com/wp-content/uploads/sites/4/2011/06/Whats-My-Testing-ROI1.pdf
Applying TDD by a single developer to legacy codebase over years reduced bugs by 50% — OMG, Test Driven Development Actually Works! (September 2012)
New projects built with TDD approach had a smaller bugs to lines of code ratio than non-TDD ones — Realizing quality improvement through test driven development: results and experiences of four industrial teams (February 2008)
5 year study with developers inexperienced in TDD showed better software quality using TDD than the industry average — A longitudinal Study of the Use of a Test-Driven Development Practice in Industry (2007)
Study on open source projects found that TDD increased code quality 20% — Quantitatively Evaluating Test-Driven Development by Applying Object-Oriented Quality Metrics to Open Source Projects (December 2009)
The deep synergies between good design and testability: https://vimeo.com/15007792
Great success stories, see REX Service-Public.fr (FR vid: https://youtu.be/eEUfsjYj3rw)