Rooster 30 days of tests
2017-08-12I’m looking to improve test coverage for Rooster, a simple password manager for geeks I’ve been building with the help of the community.
Why add tests now
A few days ago, contributor Dmitry V. Roenko updated deprecated serialization code adds unit tests to his work. Oleg Yamnikov, another contributor behind the recent command improvements and the upcoming import
command tells me he’d like to write tests as well.
Inspired by them, I challenge myself to write 1 test a day for the next 30 days with the hope that this makes testing fun and digestible, whilst revealing unnoticed bugs and making it easier to contribute code to Rooster.
Implemented tests
Here’s a list of tests I add during these 30 days:
- 12/08/2017:
default password generation length
- reveals that the
generate::PasswordSpec
struct can be improved to further simplify the code fromsrc/command/*.rs
- reveals that the
- 13/08/2017:
password list display test
- reveals a minor display bug
- 14/08/2017:
iv, salt and key length
- reveals that some code is duplicated and can be cleaned up
- 15/08/2017:
password addition with v2 store
- reveals that using the
Into
trait could help simplify some code
- reveals that using the
- 16/08/2017:
cant add password with same app name twice
- reveals nothing
- 17/08/2017:
password change with v2 store
- reveals nothing but was a good way to test deeper
Into
integration
- reveals nothing but was a good way to test deeper
- 18/08/2017:
password delete with v2 store
- reveals nothing
- 19/08/2017:
password retrieval with v2 store
- reveals that an error code was not tested (fixed in
07e3a35b
)
- reveals that an error code was not tested (fixed in
- 20/08/2017:
password presence check with v2 store
- reveals nothing
- 21/08/2017:
check that alnum password generation is alnum
- reveals nothing
- 22/08/2017:
check that hard password generation is hard
- reveals nothing
- 23/08/2017:
ffi:time returns correct time
- reveals nothing
- 24/08/2017:
unknown command returns None internally
- reveals nothing
- 25/08/2017:
key length with v1 store
- reveals nothing
- 26/08/2017:
rooster file is not created if not wanted
- adds a Dockerfile to make integration testing simpler
- 27/08/2017:
rooster file created on first run
- reveals nothing
- 28/08/2017:
setup work with Dropbox disabled
- reveals nothing
- 29/08/2017:
setup work with Dropbox enabled
- reveals nothing
- 30/08/2017:
password retry succeeds on 3rd try
- reveals nothing
- 31/08/2017:
password retry indicates corruption after 3 tries
- reveals nothing
- 01/09/2017:
rooster shows warning on corrupted file
- I learn about
bbe
, a alternative tosed
for binary data, with which I can corrupt a Rooster file, usingbbe -e 'r 77 X'
- I learn about
- 02/09/2017:
set-master-password command
- reveals nothing
- 03/09/2017:
list command
- reveals nothing
- 04/09/2017:
delete command
- reveals nothing
- 05/09/2017:
regenerate command
- reveals nothing
- 06/09/2017:
generate command
- reveals nothing
- 07/09/2017:
get command
- reveals nothing
- 09/09/2017:
rename command
- reveals nothing
- 10/09/2017:
transfer command
- reveals nothing
Overall, it turns out to be both a fun experiment as well as a good way to improve the quality of Rooster.