Open in app
Home
Notifications
Lists
Stories

Write
Josiah Ulfers
Josiah Ulfers

Home

Pinned

Hello, Medium

These are articles written for New Light Technologies. For other things I write, visit josiahulfers.com.

Hello

1 min read

Hello, Medium

These are articles written for New Light Technologies.

For other things I write, visit josiahulfers.com.

--

--


Published in New Light Technologies, Inc. (NLT

·Mar 24, 2021

Beyond assert

Last time, we built a factorial function in a test-driven style using Python’s assert statement: def factorial(n): if n < 0: raise ValueError('Factorial of negative is undefined') return n * factorial(n-1) if n else 1 assert factorial(0) == 1 assert factorial(2) == 2 assert factorial(5) == 120 try…

Testing

3 min read


Published in New Light Technologies, Inc. (NLT

·Mar 3, 2021

Writing Tests First

There’s a best way to automate your tests: write them before you write the program. If you’ve heard “test-driven development,” that’s what it means, but if you’ve never seen such a thing before, it’s an unintuitive idea. How should you start? A basic example Here, we’ll develop a function that implements the factorial…

Testing

4 min read


Published in New Light Technologies, Inc. (NLT

·Mar 3, 2021

Basic Negative Testing

In part one, we started writing a factorial function in the test-driven style. We depend on the humble “assert” statement to run our tests and we ended with this: def factorial(n): return n * factorial(n-1) if n else 1 assert factorial(0) == 1 assert factorial(2) == 2 assert factorial(5) ==…

Testing

4 min read

Josiah Ulfers

Josiah Ulfers

https://josiahulfers.com/

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Knowable