Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chujunlu/Array-methods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A practice of test-driven development

In this exercise, I recreated some of the array methods with a propose of better understanding test-driven development. The standard is to duplicate what the native array methods do as close as possible.

Here are some guidelines:

  • Write down all test cases I can think of

  • Go through carefully if I need them

  • Cut

  • Think of examples first

  • Focus on observable behaviors but not implementation

Ask myself about my test cases:

  • Are your tests lying?
  • Are you testing the smallest pieces/Are your tests atomic enough?
  • Are your tests in a sensible order?
  • Do your tests cover edge cases: empty arrays, empty indexes(at the beginning of an array, middle, end), undefined, NaN, null.

About

Recreate array methods via test-driving development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published