Test Driven Development involves writing a failing automated test to specify what is to be built. The test is then made to pass by writing code which satisfies the tested condition. Finally, the code is refactored.
13
votes
3answers
958 views
Interview Review - SOLID Principle and TDD
I had a small technical C# task using SOILD principle and TDD. But I failed to prove my coding skill through the test.
Can anyone offer any small advice for me? I am really eager to learn what my ...
6
votes
2answers
156 views
Am I implementing BDD correctly?
I'm writing a utility that validates fields on a web site. I decided I'd give Behaviour Driven Development (BDD) a try. The validator utilises rules to determine if a value the user provided is valid.
...
5
votes
2answers
158 views
Advice on my code for TDD and SOLID principles
I have recently taken a small technical test in C# and the following were expected:
All stories to be completed with an appropriate level of testing.
No actual database implementation is required, ...
5
votes
3answers
539 views
Maximum Sub-array Problem
I started taking a look at a programming challenge I had read about earlier today on 8thlight. Unfortunately, it seems to have been taken down and all I could remember about it was the problem posed: ...
4
votes
1answer
121 views
Simple class to represent progress
Progress class was written using TDD.
Interface of this class (pseudo-code):
...
3
votes
2answers
103 views
Read Lines From IIS Log
The purpose of this class is to read an IIS log (or multiple ones). One thing to note is that the columns can differ based on settings in IIS.
So a couple of concerns that I have:
Is The ILogReader ...
3
votes
3answers
121 views
Test Driving Interface Design [closed]
I have been doing TDD since I have started my first job out of university (about 5 months ago), most of which is working with legacy code. I started a personal project today and thought I would TDD ...
2
votes
4answers
164 views
How to (really) unit test an adapter?
My question is really simple: shall an adapter (design pattern) class be unit tested, and how?
Example:
I want to create a class ClientSocket with PHP, which is ...
2
votes
1answer
59 views
Using RSpec subject to setup a test
I find myself using subject blocks in my tests to setup example because it is succinct. However is this considered bad form and can it have undesired consequences?
...
2
votes
1answer
93 views
General thoughts on the style of this rspec-rails test
Here's a test from a Rails app I'm working on. I want to know if I'm using describe, let, ...
2
votes
1answer
54 views
A C# class to check if one JSON tree (de-serialised as ExpandoObject / Array etc) contains another
I wrote this partly as a learning exercise in TDD. Could I please have feedback on both how to improve the quality of the code and the completeness of the tests?
I used LinqPad as my IDE for this, ...
1
vote
2answers
127 views
TDD Approach and Simple Solution
How many tests could you write for the enum class below. I am looking for the following output given the following command:
...
1
vote
1answer
107 views
unit-testing / mocking a class which contains functionality which depends on itself
Take the below code:
...
0
votes
1answer
289 views
How to write simple code using TDD
Me and my colleagues do a small TDD-Kata practice everyday for 30 minutes. For reference this is the link for the excercise http://osherove.com/tdd-kata-1/
The objective is to write better code ...