@@ -10,7 +10,31 @@ overall quality of the approved katas. Also, as long as [#123] stands, one
10
10
cannot change the tests in approved katas with more than 500 solutions.
11
11
12
12
[ #123 ] : https://github.com/Codewars/codewars.com/issues/123
13
+
14
+
15
+ ## Consider writing your tests first
13
16
17
+ Before we actually dive into the many tips one can follow on Codewars, you
18
+ should get familiar with the test driven development (TDD) cycle. It's not
19
+ required to follow it in order to write katas for Codewars, but _ recommended_ .
20
+
21
+ So what is the cycle? Essentially, it's the following:
22
+
23
+ 1 . Add a test
24
+ 2 . Run tests and verify that the new one fails
25
+ 3 . Adjust your solution
26
+ 4 . Run tests and verify that the new solution passes all tests
27
+ 5 . Refactor your solution (optional)
28
+
29
+ That's it. Note that the important part is the very first step: you write the
30
+ tests first. "Why?", you're probably asking. "I know my solution already!"
31
+ Well, are you sure about that? Some katas have long standing issues since the
32
+ original author didn't check a few edge cases.
33
+
34
+ However, since Codewars isn't running on your own machine, you should adjust
35
+ the cycle a little bit and add more than a single test. The cycle works best
36
+ with fast iterations, and the remote nature of Codewars makes this a little bit
37
+ hard. Still, writing at least part of your tests first is __ very__ recommended.
14
38
15
39
## Make your test descriptive
16
40
@@ -245,7 +269,7 @@ def add_three_reference(a,b,c):
245
269
return a + (b + c)
246
270
247
271
print (add_three_reference(1e-12 ,1e-12 ,1 ) == add_three(1e-12 ,1e-12 ,1 ))
248
- # False
272
+ # False
249
273
```
250
274
251
275
### Relative error testing
0 commit comments