Why might you write a test even before writing the code?
Answer
in order to have some example inputs and outputs in your mind
Tags
#python #sicp
Question
Why might you write a test even before writing the code?
Answer
?
Tags
#python #sicp
Question
Why might you write a test even before writing the code?
Answer
in order to have some example inputs and outputs in your mind
If you want to change selection, open original toplevel document below and click on "Move attachment"
Parent (intermediate) annotation
Open it The key to effective testing is to write (and run) tests immediately after
implementing new functions. It is even good practice to write some tests before
you implement, in order to have some example inputs and outputs in your mind.
A test that applies a single function is called a unit test. Exhaustive unit
testing is a hallmark of good program design.
Original toplevel document
1.5 Control cted result, the
run_docstring_examples function will report this problem as a test failure.
When writing Python in files, all doctests in a file can be run by starting
Python with the doctest command line option:
python3 -m doctest
<span>The key to effective testing is to write (and run) tests immediately after
implementing new functions. It is even good practice to write some tests before
you implement, in order to have some example inputs and outputs in your mind.
A test that applies a single function is called a unit test. Exhaustive unit
testing is a hallmark of good program design.
Continue:
1.6 Higher-Order Functions
Composing Programs by John
DeNero, based on the textbook Structure and
Summary
status
not learned
measured difficulty
37% [default]
last interval [days]
repetition number in this series
0
memorised on
scheduled repetition
scheduled repetition interval
last repetition or drill
Details
No repetitions
Discussion
Do you want to join discussion? Click here to log in or create user.