tdd

design of mid-large sized application when doing TDD? [closed]

こ雲淡風輕ζ 提交于 2019-11-28 17:18:54
I have a good grasp of unit testing, DI, mocks, and all the design principal goodness required to have as close to full code coverage as humanly possible (single responsibility principal, think 'how will i test this' as I code, etc...). My most recent app, I did not code doing true TDD. I kept unit-testing in mind as I coded, and wrote my tests after writing the code, refactoring, etc.. I did TDD when it was 'easy' to do... however I did not have as good of a grasp as I do now... That was the first project I made full use of DI, mocking frameworks, etc, and the first which had full code

Should I practice “mockist” or “classical” TDD?

孤者浪人 提交于 2019-11-28 17:12:39
I've read (and re-read) Martin Fowler's Mocks Aren't Stubs . In it, he defines two different approaches to TDD: "Classical" and "Mockist" . He attempts to answer the question " So should I be a classicist or a mockist? ", but he admits that he has never tried mockist TDD on "anything more than toys." So I thought I'd ask the question here. Good answers may repeat Fowler's arguments (but hopefully more clearly) or add arguments that he didn't think of or that others have come up with since Fowler last updated the essay back in January 2007. I don't think you need to choose one over the other.

When to unit-test vs manual test

我是研究僧i 提交于 2019-11-28 16:41:30
While unit-testing seems effective for larger projects where the APIs need to be industrial strength (for example development of the .Net framework APIs, etc.), it seems possibly like overkill on smaller projects. When is the automated TDD approach the best way, and when might it be better to just use manual testing techniques, log the bugs, triage, fix them, etc. Another issue--when I was a tester at Microsoft, it was emphasized to us that there was a value in having the developers and testers be different people, and that the tension between these two groups could help create a great product

Why is design-by-contract not so popular compared to test-driven development?

混江龙づ霸主 提交于 2019-11-28 16:31:41
You may think this question is like this question asked on StackOverflow earlier. But I am trying to look at things differently. In TDD, we write tests that include different conditions, criteria, verification code. If a class passes all these tests we are good to go. It is a way of making sure that the class actually does what it's supposed to do and nothing else. If you follow Bertrand Meyers ' book Object Oriented Software Construction word by word, the class itself has internal and external contracts, so that it only does what its supposed to do and nothing else. No external tests required

Unit tests vs integration tests with Spring

不羁岁月 提交于 2019-11-28 16:31:27
I'm working on a Spring MVC project, and I have unit tests for all of the various components in the source tree. For example, if I have a controller HomeController , which needs to have a LoginService injected into it, then in my unit test HomeControllerTest I simply instantiate the object as normal (outside of Spring) and inject the property: protected void setUp() throws Exception { super.setUp(); //... controller = new HomeController(); controller.setLoginService( new SimpleLoginService() ); //... } This works great for testing each component as an isolated unit - except now that I have a

Should I Use TDD?

折月煮酒 提交于 2019-11-28 16:21:17
I'm the only developer in my (very small) company and I'm about to start on a medium sized ASP.NET web application for said company. I'm trying to figure out if I should learn Test Driven Development (TDD) and implement it in this application. I need to start developing our new application shortly and I'm worried about testing. I've programmed for many years but have never done any unit testing. I've read numerous online resources regarding TDD but I'm unsure whether I'll have a 'good enough' grasp on it to make it effective in the application. It depends on where your priorities lie. If you

What should I consider when choosing a mocking framework for .Net

落花浮王杯 提交于 2019-11-28 16:13:05
There are lots of mocking frameworks out there for .Net. There is no clear winner that has superseded the others in every way. The leading mocking frameworks also have many different styles of usage. The time it takes to learn all of the mocking frameworks well enough to decide which to use is unreasonable. I don’t believe that we have yet reached a stage that we can talk about the best mocking framework. So what questions should I be asking, both about the project, and about myself, to help decide on the best mocking framework to use, in a given case? It would also be useful to know why you

Does Test Driven Development take the focus from Design? [closed]

隐身守侯 提交于 2019-11-28 16:01:48
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago . I have mixed feelings about TDD. While I believe in testing I have a issues with the idea of the test driving my development effort. When you code to satisfy some tests written for an interface for requirements you have right now, you might shift your focus from building

Developing UI in JavaScript using TDD Principles

荒凉一梦 提交于 2019-11-28 15:49:17
问题 I've had a lot of trouble trying to come up with the best way to properly follow TDD principles while developing UI in JavaScript. What's the best way to go about this? Is it best to separate the visual from the functional? Do you develop the visual elements first, and then write tests and then code for functionality? 回答1: I've done some TDD with Javascript in the past, and what I had to do was make the distinction between Unit and Integration tests. Selenium will test your overall site, with

TDD and BDD Differences

蹲街弑〆低调 提交于 2019-11-28 15:43:20
I honestly don't see the difference between BDD and TDD. I mean, both are just tests if what is expected happens. I've seen BDD Tests that are so fleshed out they practically count as TDD tests, and I've seen TDD tests that are so vague that they black box a lot of code. Let's just say I'm pretty convinced that having both is better. Here's a fun question though. Where do I start? Do I start out with high level BDD tests? Do I start out with low level TDD tests? I honestly don't see the difference between BDD and TDD. That's because there isn't any. I mean, both are just tests if what is