Skip to content

Commit 7d58f0b

Browse files
committed
update footer year and formatting in tdd blog
1 parent 98d35e3 commit 7d58f0b

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ enableRobotsTXT = false
5757
summary_large_truncate = 120 # How many characters to include in the summary of the team bios (large layout) before truncating
5858

5959
[params.footer]
60-
copyright_text = '© 2023 Infraspec - Delivering high impact transformational work'
60+
copyright_text = '© 2024 Infraspec - Delivering high impact transformational work'
6161

6262
[menu]
6363
# Main Menu

content/blog/tdd-design-benefits.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,44 @@ As defined above, we write unit tests even before we write the code. This might
1818
To make this easier to understand, try to think of it like this. It is not testing but stating what you expect the code to do. With this, you are trying to put your expectation before writing the code.
1919
This shift in mindset, helps you be very clear and concise about what you want and how you want your software to behave.
2020

21-
Since we don't have any code to test, this inversion of thought process and development style now poses a few interesting questions.
21+
Since we don't have any code to test, this inversion of thought process and development style now poses a few interesting questions:
22+
2223
1. What do we expect from the function and how do we want it to behave?
2324
1. What should be the function/method name? What would make sense from the caller's perspective?
2425
1. What would be the Class name in the case of Object Oriented language?
2526
1. What does the function need as dependencies for it to perform its task?
2627

2728
Let's see how these questions help us one by one
29+
2830
### Q1: What do we expect from the function and how do we want it to behave?
31+
2932
Answering this question helps us to focus on the exact intended outcome before implementing the code.
3033
This enables us to break the problem statement into smaller chunks as we need to test for each expectation separately.
3134
This helps us build the software incrementally, and discover edge cases by asking how should it work for weird input values.
3235

3336
### Q2: What should be the function name? What would make sense from the consumer perspective?
37+
3438
Since we would be having the consumer of the function even before it is implemented, it forces us to think of a good function name.
35-
This helps us in understanding how different pieces of code will use this new function.
39+
This helps us in understanding how different pieces of code will use this new function.
3640
This significantly improves readability and guides us to arrive at meaningful names.
3741

3842
### Q3: What would be the Class name in case of Object Oriented language?
39-
Naming as we all know is one of the hardest things for software engineers.
43+
44+
Naming as we all know is one of the hardest things for software engineers.
4045
One thing I have realised over the years is naming in a meaningful manner only takes iterations.
4146
But one easy way to get started in the right direction is to name things from the consumer's point of view.
4247
What this means is when we start to think from the consumer's point of view, it starts becoming clear as to how it could be used.
4348
And test cases are the first consumers of the code.
4449
This like the previous one helps us improve readability ad arrive at meaningful class names.
4550

4651
### Q4: What does the function/class need as dependencies for it to perform the task?
52+
4753
When we write code, we sometimes expect certain things to be present or need to be passed in for the new code to work.
4854
This helps us understand how complicated the code setup could be if it needs a lot of things.
4955
This acts as an indicator and surfaces tight coupling if any early on in the development lifecycle.
5056
We could consider this as a tool which would prevent the design of the system from having high coupling and reduce complexity.
5157

52-
> ### TDD is not just about having tests but a lot more than that. It not only helps us verify the correctness of the software but if practised well, helps us design the software well. This is why I sometimes think of TDD as **Test Driven Design**.
58+
> ### TDD is not just about having tests but a lot more than that. It not only helps us verify the correctness of the software but if practised well, helps us design the software well. This is why I sometimes think of TDD as **Test Driven Design**
5359
5460
All of this sounds too good, but it's easier said than done.
5561
Here is one of the many reasons why people are not able to successfully adopt this practice into their development lifecycle.

0 commit comments

Comments
 (0)