The FizzBuzz Kata Step-By-Step Using the Pseudocode Programming Process
— software development, katas, coding, fizzbuzz — 1 min read
For my second attempt at the FizzBuzz kata, I used the Pseudocode Programming Process.
I recently tried the FizzBuzz kata again, this time using the Pseudocode Programming Process described by Steve McConnell in Code Complete. The last time I tried this kata I used test-driven development instead.
- Open Terminal in VS Code, navigate to desired folder
- run
dotnet new xunit
to create project - use
code .
to open that project - Go to Ardalis's FizzBuzz Kata Instructions
- Create
public class Formatter
under the same namespace as the classUnitTest1
is declared under - Create
public string FizzBuzz(int input)
inFormatter
- Write pseudocode in
FizzBuzz
- See how I did this step here (note my first line of pseudocode here is unnecessary)
- Write code fulfilling the kata instructions
- Your pseudocode should be thorough enough that this step is fairly mechanical
- Leave your pseudocode as comments - it should be thorough and specific enough to serve as documentation (especially in such a simple program)
- See how I did this step here
- Write and run tests
- Use Act, Arrange, Assert
- For more in-depth descriptions of writing tests, read my previous step-by-step of the FizzBuzz kata
- Done!
- See my final code here
Thanks for reading! I hope you find this and other articles here at ilyanaDev helpful! Be sure to follow me on Twitter @ilyanaDev.