Skip to content

Commit 15b0bce

Browse files
committed
reverted all unecessary header changes as request
1 parent 1068fb2 commit 15b0bce

File tree

9 files changed

+24
-27
lines changed

9 files changed

+24
-27
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
An introduction to testing and continuous integration using Python.
44

5-
Much of this lesson came from the book
6-
*[Effective Computation in Physics]
7-
(http://www.amazon.com/Effective-Computation-Physics-Anthony-Scopatz/dp/1491901535/)*
8-
by Anthony M. Scopatz and Kathryn D. Huff.
5+
Much of this lesson came from the book *[Effective Computation in Physics] (http://www.amazon.com/Effective-Computation-Physics-Anthony-Scopatz/dp/1491901535/)* by Anthony M. Scopatz and Kathryn D. Huff.
96

107
> ## Note
118
>

_episodes/01-basics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ title: Basics of Testing
33
teaching: 5
44
exercises: 0
55
questions:
6-
- "Why would you not want to test?"
6+
- "Why test?"
77
objectives:
88
- "Understand the place of testing in a scientific workflow."
99
- "Understand that testing has many forms."
1010
keypoints:
11-
- "Tests compare that the result observed from running code is the same as what was expected ahead of time."
12-
- "Tests should be written at the same time as the code they are testing is written."
11+
- "Tests check whether the observed result, from running the code, is what was expected ahead of time."
12+
- "Tests should ideally be written before the code they are testing is written, however some tests must be written after the code is written."
1313
- "Assertions and exceptions are like alarm systems embedded in the software, guarding against exceptional bahavior."
1414
- "Unit tests try to test the smallest pieces of code possible, usually functions and methods."
1515
- "Integration tests make sure that code units work together properly."

_episodes/02-assertions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Assertions
33
teaching: 10
44
exercises: 0
55
questions:
6-
- "How do I make sure the value I want is the value I receive?"
6+
- "How can we compare observed and expected values?"
77
objectives:
88
- "Assertions are one line tests embedded in code."
99
- "Assertions can halt execution if something unexpected happens."
@@ -75,7 +75,7 @@ def mean(num_list):
7575
> Hint: Use the [isinstance function](https://docs.python.org/2/library/functions.html#isinstance).
7676
{: .callout}
7777

78-
> ## Testing similarity between variables
78+
> ## Testing Near Equality
7979
>
8080
> Assertions are also helpful for catching abnormal behaviors, such as those
8181
> that arise with floating point arithmetic. Using the assert keyword, how could

_episodes/03-exceptions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Exceptions
33
teaching: 10
44
exercises: 0
55
questions:
6-
- "How do I capture errors that I do not anticipate?"
6+
- "How do I handle unusual behavior while the code runs?"
77
objectives:
88
- "Understand that exceptions are effectively specialized runtime tests"
99
- "Learn when to use exceptions and what exceptions are available"
@@ -79,7 +79,7 @@ def mean(num_list):
7979
~~~
8080
{: .python}
8181

82-
> ## Remember
82+
> ## What else could go wrong?
8383
>
8484
> 1. Think of some other type of exception that could be raised by the try
8585
> block.

_episodes/04-units.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Unit Tests
33
teaching: 10
44
exercises: 0
55
questions:
6-
- "How much is a unit of code?"
6+
- "What is a unit of code?"
77
objectives:
88
- "Understand that functions are the atomistic unit of software."
99
- "Understand that simpler units are easier to test than complex ones."
@@ -30,7 +30,7 @@ project and language to language. A good guideline is that if the code cannot
3030
be made any simpler logically (you cannot split apart the addition operator) or
3131
practically (a function is self-contained and well defined), then it is a unit.
3232

33-
> ## Note to self
33+
> ## Functions are Like Paragraphs
3434
>
3535
> Recall that humans can only hold a few ideas in our heads at once. Paragraphs
3636
> in books, for example, become unwieldy after a few lines. Functions, generally,

_episodes/06-edges.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Anecdotally, it is important to test edges cases because this is where errors te
3131
arise. Qualitatively different behavior happens at boundaries. As such,
3232
they tend to have special code dedicated to them in the implementation.
3333

34-
> ## Consider a Fibonacci sequence
34+
> ## Consider the Fibonacci sequence
3535
>
3636
> Take a moment to recall everything you know about the Fibonacci sequence.
3737
>
@@ -88,7 +88,7 @@ noninteger values are not valid inputs. Tests for these classes of numbers serve
8888
you well if you want to make sure that the function fails as expected. Indeed, we
8989
learned in the assertions section that this is actually quite a good idea.
9090

91-
> ## Implement these points
91+
> ## Test for Graceful Failure
9292
>
9393
> The `fib()` function should probably return the Python built-in
9494
> `NotImplemented` value for negative and noninteger values.
@@ -158,7 +158,7 @@ def test_edge_y():
158158
~~~
159159
{: .python}
160160

161-
> ## Final steps
161+
> ## Write a Corner Case
162162
>
163163
> The sinc2d example will also need a test for the corner case, where both x
164164
> and y are 0.0.

_episodes/07-integration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Integration and Regression Tests
33
teaching: 10
44
exercises: 0
55
questions:
6-
- "What is beyond a unit test?"
6+
- "How do we test more than a single unit of software?"
77
objectives:
88
- "Understand the purpose of integration and regression tests"
99
- "Understand how to implement an integration test"
@@ -19,7 +19,7 @@ the gears and cogs that make up the system. On their own, they can be of the hig
1919
quality. Unit tests verify that each gear is well made. However, the clock still
2020
needs to be put together. The gears need to fit with one another.
2121

22-
> ## Further explanation
22+
> ## Telling The Time
2323
>
2424
> _Integration tests_ are the class of tests that verify that multiple moving
2525
> pieces and gears inside the clock work well together. Where unit tests
@@ -104,7 +104,7 @@ the expected result should be, regression tests look to the past for the
104104
expected behavior. The expected
105105
result is taken as what was previously computed for the same inputs.
106106

107-
> ## Further explanation
107+
> ## The Past as Truth
108108
>
109109
> Regression tests assume that the past is "correct." They are great for
110110
> letting developers know when and how a code base has changed. They are not

_episodes/08-ci.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Continuous Integration
33
teaching: 10
44
exercises: 0
55
questions:
6-
- "How can I make sure my changes are compatable with the larger code base?"
6+
- "How can I automate running the tests on more platforms than my own?"
77
objectives:
88
- "Understand how continuous integration speeds software development"
99
- "Understand the benefits of continuous integration"
@@ -12,7 +12,7 @@ objectives:
1212
keypoints:
1313
- "Servers exist for automatically running your tests"
1414
- "Running the tests can be triggered by a GitHub pull request"
15-
- "CI allows cross platform build testing"
15+
- "CI allows cross-platform build testing"
1616
- "A `.travis.yml` file configures a build on the travis-ci servers"
1717
- "Many free CI servers are available"
1818
---
@@ -23,7 +23,7 @@ As its name implies, continuous integration integrates the test suite into the
2323
development process. Every time a change is made to the repository, the
2424
continuous integration system builds and checks that code.
2525

26-
> ## Example
26+
> ## Thought Experiment: Does Your Software Work on Your Colleague's Computer?
2727
>
2828
> Imagine you developed software on a MacOSX computer. Last week, you helped
2929
> your office mate build and run it on their Linux computer. You've made some
@@ -40,7 +40,7 @@ repository, rebuild the code, and run the tests. If you don't have a build
4040
system, it could take all afternoon just to see if your new changes are
4141
compatible.
4242

43-
> ## It saves you time!
43+
> ## Let The Computers Do The Work
4444
>
4545
> Scientists are good at creative insights, conceptual understanding, critical
4646
> analysis, and consuming espresso. Computers are good at following instructions.
@@ -66,7 +66,7 @@ repository, we'll need to put our code online to make use of this kind of
6666
server (unless we are able/willing to set up our own CI server).
6767

6868

69-
> ## First steps...
69+
> ## Set Up a Mean Git Repository on GitHub
7070
>
7171
> Your `mean.py` `test_mean.py` files can be the contents of a repository on
7272
> GitHub.

_episodes/09-tdd.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ keypoints:
1111
- "Test driven development is a common software development technique"
1212
- "By writing the tests first, the function requirements are very explicit"
1313
- "TDD is not for everyone"
14-
- "TDD requires vigilance for success (cheating leads to failure)"
14+
- "TDD requires vigilance for success"
1515
---
1616

1717
Test-driven Development (TDD) takes the workflow of writing code and writing
@@ -26,7 +26,7 @@ needed, you write another test and then go back and modify the function. You
2626
repeat this process of test-then-implement until the function is completely
2727
implemented for your current needs.
2828

29-
> ## Where it comes from
29+
> ## The Big Idea
3030
>
3131
> This design philosophy was most strongly put forth by Kent Beck in his book
3232
> _Test-Driven Development: By Example_.
@@ -44,7 +44,7 @@ you start writing code, you should be considering how to test that code. The
4444
tests should be written and presented in tandem with the implementation. **Testing
4545
is too important to be an afterthought.**
4646

47-
> ## Who is using it?
47+
> ## You Do You
4848
>
4949
> Developers who practice strict TDD will tell you that it is the best thing since
5050
> sliced arrays. However, do what works for you. The choice whether to pursue

0 commit comments

Comments
 (0)