The FizzBuzz Kata Step-By-Step Using the Pseudocode Programming Process
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
dotnet new xunitto create project
code .to open that project
- Go to Ardalis's FizzBuzz Kata Instructions
public class Formatterunder the same namespace as the class
UnitTest1is declared under
public string FizzBuzz(int input)in
- Write pseudocode in
- 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
- 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.