Questions tagged [tdd]

TDD stands for Test-Driven Development, or Test-Driven Design. It is the practice of writing a unit test before writing code to satisfy it, in what is known as the Red-Green-Refactor cycle.

1
vote
2answers
101 views

Best practice to TDD a unit of work in frontend JavaScript

Context Right now, I'm working on an overhaul of an edit page for a menu, which is quite involved in and of itself. I have identified the issue: there is literally no structure in place for when a ...
4
votes
1answer
44 views

Design test class dependent on current datetime, 24 hours a day, seven days a week

I need to create a test to verify my NewBusinessDateTime.calculate(Integer hoursToAdd) works. The sudo code of what calculate() does is: IF currentDateTime.addHours(hoursToAdd) IS WITHIN BUSINESS ...
10
votes
5answers
129 views

How to handle “fake” unit tests that don’t really test anything?

I’m a part of a large software project which is supposed to use TDD. There are maybe 90 devs across the world. Upon review of tests for software components, I determined that a significant number of ...
1
vote
1answer
178 views

Can we use java to design specflows?

I am currently learning regarding specflows to design acceptance testing using cucumber, But I am getting information that we can not use java or Java script programming language only .net is ...
1
vote
2answers
57 views

What is the best way to write TDD test cases? Can I achieve TDD through JMeter?

I have been asked to write test cases in the TDD style. I have no experience about writing TDD test cases. I have read about TDD and in essence it talks about defining test cases prior to code and ...
2
votes
1answer
233 views

Automated test generator

After a long road with Randoop.NET as a unit test suggestion tool, my developing team has decided to upgrade to a commercial tool which will provide us a full unit testing framework for professional ...
2
votes
1answer
37 views

Split roles for devs doing feature implementation and integration testing?

I'm looking out for patterns how to more effectively bring QA topics into our agile product development team. One idea is to let one developer do the implementation with TDD (so alongside unit tests) ...
1
vote
2answers
56 views

Behat tests take over an hour to run

We have a test suite of around 60 feature files, 135 scenarios, 1800 steps. We currently use the free 100 builds on semaphoreCI which occasionally successfully runs all of the tests, but quite often ...
4
votes
5answers
219 views

How do I build a personal project big enough to learn from automated testing it? [closed]

It doesn't come to me, in my head, how I should build a project big enough, like abig software, so I can test it. I've been reading about testing and I wanna to learn it from zero. The language that I ...
1
vote
1answer
4k views

How to fetch data from excel sheet in selenium web driver? [closed]

How to fetch data from excel sheet in selenium web driver, suppose I have 44 URLs in excel sheet I need to fetch it through selenium webdriver and wants to hit the URL.
6
votes
2answers
179 views

Is dependency injection suitable for TDD?

I used dependency injection in some projects but I didn't fully understand why. I think it is partly to facilitate TDD - if we use dependency injection then many dependencies of the software can be ...
1
vote
0answers
130 views

JUnit tearDown implementation for Spring-test's SimpleNamingContextBuilder/DataSource

I'm using this code snippet to mock JDBC Datasources from within Junit4: @Before public void setUp() throws Exception { try { SimpleNamingContextBuilder builder = new ...
4
votes
1answer
175 views

Given When Then - is one 'then' per test acceptable usage?

I don't know if this has a sort review process, but here goes (direct me elsewhere if appropriate) I have written these tests, and wondered if my use of Given, When and Then was correct. I ask ...
3
votes
1answer
65 views

Correct aproach to test this method

Overview: the problem I´m trying to solve is: I have some canceled orders in my database that I need to call a government WebService to disable the fiscal numbers associated with these orders. The ...
2
votes
2answers
686 views

Why does the test always fails at the start in TDD?

In TDD the test always fails at the start because A) The quality of Code is bad B) The developers don’t know the functionality C) The developers can not test D) There is no code
1
vote
2answers
56 views

What is the correct, conventional name for a test written via BDD

If I have a class/object/component, and I test its API directly, in complete isolation, mocking/stubbing any complex parameters on which it depends, it's called a Unit Test. If I have a whole ...
2
votes
2answers
241 views

TDD example for building website

I am looking into TDD and I don't fully understand the approach. I am a web developer using PHP and I can't find any examples of TDD which I can relate to. So far this is what I understand of ATDD: ...
2
votes
2answers
2k views

Importance of using TDD with Selenium/Webdriver

I want to know what is the importance of test-driven development with Selenium/Webdriver? Is it a framework ?
1
vote
6answers
281 views

Will writing unit tests block developers from coding?

We are about to implement TDD in our software company and we met some serious questions. As you know, this is the TDD life cycle: Add a test Run all tests and see if the new test fails Write the ...
11
votes
5answers
2k views

What is exact difference between TDD and BDD?

What is exact difference between TDD and BDD? Could you please briefly explain them to me?
3
votes
4answers
345 views

QA in an Extreme Programming Agile Environment

I've been a QA in an agile environment before, but I've now found myself at a company that practices Extreme Programming to the T. I was wondering where you guys think that a somewhat traditional ...
2
votes
1answer
152 views

Challenges of begining test driven development with legacy codebase [duplicate]

I am beginning development on a legacy codebase and adding new functionality. The legacy codebase has no tests defined at all, and I dont have full control over it. I want to use TDD to help ensure ...
4
votes
5answers
1k views

What are the disadvantages of test driven development?

Today one of my peers gave a presentation on test driven development, he mentioned several advantages of TDD and it seems to be an effective practice. However, I was wondering what some of the ...
2
votes
1answer
119 views

TDD and Refactoring

Re-factoring code seems to be the more time consuming area of TDD, is there a way of knowing if you have spent too much time doing so? Or maybe a way of limiting the amount of re-factoring that must ...
1
vote
1answer
57 views

How to dissect a large legacy codebase and start using TDD

If I was to inherit a large codebase, how would I start refactor the application using TDD? The application has layers of authentication(financial banking company), and frankly, not knowing where to ...
1
vote
1answer
65 views

Test driven development appropriateness

I am aware that there are many advantages of test driven software development. However, I'm wondering if there are situations in which test driven development is not appropriate or just downright not ...
1
vote
1answer
15 views

What methods or resources could I use to refactor current programs to use test-driven development?

So what are some current methodologies or even automated test software that I could use to refactor current code to be more test-driven?
0
votes
1answer
71 views

Refactoring code in TDD cycle and the appropriate time to do so?

When it comes to the TDD cycle, how far through the testing should refactoring the code take place (incremental after each test or at the end)? And how would this affect the TDD cycle and the time ...
1
vote
1answer
403 views

TDD and client-server interactions

I'm new to software development and I am writing some functions that send data to and ask for data from a server. If I wanted to use test driven development when writing these functions, what would be ...
2
votes
2answers
99 views

Is TDD used with all types of testing?

The way TDD has been described to me makes it sound like TDD is only really useful with unit testing. Does TDD mean all types of testing, such as Acceptance testing, and functional tests?
3
votes
2answers
152 views

TDD in a two-week sprint? Practical?

On one hand, it may take a while (or a long time) to create and run tests with TDD. The worst case scenario is when the test cases fail and the entire program fails. Refactoring may take longer than ...
0
votes
1answer
36 views

How would I write a test for a database system such as Redis?

So i'm looking into databases and I want to use Redis, but I would like to know how I would go about writing tests for a database such as this before starting with it.
0
votes
2answers
135 views

Using TDD when developing a database schema?

I am fairly new to TDD and database development. If I wanted to use test driven development when I am trying to create a database schema how would I do that? What are the common tools and processes ...
2
votes
2answers
399 views

What are some common pitfalls of Test Driven Development?

I'm new to test driven development. What are some recommendations when writing test cases as well as to avoiding common mistakes for TDD?
3
votes
1answer
187 views

Agile test driven development

What is a good way to introduce to managers, who are have always used a waterfall software development mental model, sometimes known as the V model, that it is worth moving to a more agile-Test Driven ...
3
votes
4answers
2k views

Strategy to handle legacy bugs

There are a number of new developers and testers in our team. When the testers are testing the new features the developers built, they are finding a number of issues, which is not strictly in the ...
0
votes
4answers
190 views

Reviewing unit tests before implementation

I am going to adopt TDD in our team and one of the ideas I have is to review tests first. So one would write interfaces, mocks, and tests first, submit them for a code review and once interfaces and ...
4
votes
3answers
436 views

Is specification replaced by tests in TDD?

I believe not, but as I read and read about testing in agile approach, separation between developers and QA, and between tests and specification becomes more and more fuzzy. I read Test-Driven ...
2
votes
4answers
925 views

Should I write a small test for every ticket / defect?

We have unit and integrations tests in our project and want to work test driven. One questions that raise up is this: When a ticket is created because somebody found a bug, should we create a small ...
13
votes
2answers
2k views

How to avoid redundant tests

We are building an application using a completely test-driven approach. As developers, we are very familiar with unit tests but haven't been exposed to integrated / functional / acceptance tests. ...
7
votes
4answers
9k views

What are recommended scenarios to use Selenium Tests for?

My company is introducing BDD into our projects. Our customers have differents processes-cases wich also may fork at specific points. It is a mostly long and tedious work to test each case and each ...
15
votes
5answers
627 views

In TDD, do tests need to be automated?

My manager's manager (... and his manager, and everyone else who wears a suit) at my firm is talking about how we really need to transition to TDD because it's better than what we're doing now. ...
15
votes
4answers
321 views

If I didn't use TDD but want to transition to agile, should I go back and create those unit tests?

In an transitioning agile environment, if there was no Test Driven Development (no unit tests created), should you create unit tests to catch up on technical debt? and to what extent? Should ...
28
votes
4answers
2k views

Developing Unit Tests While Refactoring Legacy Code?

I have a big code library that I need to refactor in order for it to fit more nicely together (one big problem is there aren't clear enough boundaries between each component). Since there will be ...
7
votes
3answers
530 views

Suggestions for “Selling” TDD, and BDD to sceptical non engineering managers

Let's say you are a developer (specifically, the team lead) and you want to improve the quality of your company's products. Since you cannot change the whole company, you focus on what you and your ...