tdd

Test driven development for signal processing libraries

浪子不回头ぞ 提交于 2019-12-06 18:47:39
问题 I work with audio manipulation, generally using Matlab for prototyping, and C++ for implementation. Recently, I have been reading up on TDD. I have looked over a few basic examples and am quite enthusiastic about the paradigm. At the moment, I use what I would consider a global 'test-assisted' approach. For this, I write signal processing blocks in C++, and then I make a simple Matlab mex file that can interface with my classes. I subsequently add functionality, checking that the results

Creating mock data for unit testing

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 18:21:33
问题 I consider myself still pretty new to the TDD scene. But find that no matter which method I use (mock framework or stubbing my own objects) I find that I have to write a lot of code to create mock data. I like the idea of loading up objects to create an in-memory database. But what I don't like is cluttering up my tests with a ton of code for the sole purpose of creating mock data. This is especially the case when the data needs to account for all the different cases. I'd love some

Unit test wrapper objects?

こ雲淡風輕ζ 提交于 2019-12-06 17:12:28
问题 I try to use TDD as much as I can. When I do, I stowe all comunication with the outside away in wrapper classes. A few minutes ago, I made a wrapper for the static class Directory , so I can test my other code without talking to the actual file system. But what about unit testing the wrapper itself? Since I use TDD, it nags me that I haven't written tests for it. On the other hand, It is a wrapper and nothing else, so do I really need to? 回答1: I tend to do the same and not worry about unit

TDD on client-server application

核能气质少年 提交于 2019-12-06 15:04:46
Currently I'm creating a server application to receive protocol-specific messages. I need to create tests to ensure that I've implemented the protocol correctly. Is this some kind of integration testing? If positive, can I make an integration testing with unit testing tools? And finally, what is the best way to create these kind of tests? If you know what the correct responses are, then here's what I'd do: Separate the class responsible for the logic of handling the protocol from the code dealing with the mechanics of the connection. Write tests, one at a time, specifying the correct response

Application Testing with Rails

倾然丶 夕夏残阳落幕 提交于 2019-12-06 12:04:16
This is more of a general question and some sort of best practice discussion. How would one test a Rails application? There are mantras like BDD and TDD and frameworks like RSpec and Cucumber but how much is enough and what is the best way to go? Is it enough to use Cucumber as integration tests? Are you guys writing additional unit tests, too? So what and how is your Rails testing strategy? Looking forward to good opinions... How would one test a Rails application? Thoroughly, aiming for Eighty percent coverage and no less ! The actual decision as to "how" is easy, but "how much" can be a

where I can get some tutorials on Java FitNesse and Slim? [closed]

天涯浪子 提交于 2019-12-06 11:56:39
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I am studying TDD using FitNesse and I am looking some tutorials and examples. I would like to know where to find a good material. 回答1

Capybara ajax race conditions

♀尐吖头ヾ 提交于 2019-12-06 11:28:33
问题 I am frequently running into issues in capybara with request tests failing because capybara is not waiting for ajax events to complete before moving on. Google seems to indicate I should be using :resynchronize option for my tests to fix this. But it is not working. To prove this is an issue, failing tests can be fixed by putting a sleep statement after the ajax call. This seems hacky any bad practice as the appropriote delay will vary depending on the speed of the machine running the tests.

TDD : Breaks all the existing test cases while refactoring the code

♀尐吖头ヾ 提交于 2019-12-06 10:54:53
问题 I have started following TDD in my project. But ever since I started it after reading some articles, I am bit confused since the development has slowed down. Whenever I refactor my code, I need to change the existing test cases I have written before because they will start failing. Following is the example: public class SalaryManager { public string CalculateSalaryAndSendMessage(int daysWorked, int monthlySalary) { int salary = 0, tempSalary = 0; if (daysWorked < 15) { tempSalary =

TDD: Unit Testing Asynchronous Calls

…衆ロ難τιáo~ 提交于 2019-12-06 09:55:42
guys: I'm working on an application, and building it with unit testing. However, I'm now in a situation where I need to test asynchronous calls. For example, - (void)testUserInfoBecomesValidWhenUserIsBuiltSuccessfully { if ( ![userBuilder userInfoUpToDate] ) { [userBuilder buildUser]; } STAssertTrue([userBuilder userInfoUpToDate], @"User information is not valid before building the user"); } What is the general practice for testing such things? userInfoUpToDate is expected to be updated asynchronously. Thanks! William Sometimes there is a temptation to test things which you don't usually test

Convert C# unit test names to English (testdox style)

青春壹個敷衍的年華 提交于 2019-12-06 08:23:59
问题 I have a whole bunch of unit tests written in MbUnit and I would like to generate plain English sentences from test names. The concept is introduced here: http://dannorth.net/introducing-bdd This is from the article: public class CustomerLookupTest extends TestCase { testFindsCustomerById() { ... } testFailsForDuplicateCustomers() { ... } ... } renders something like this: CustomerLookup - finds customer by id - fails for duplicate customers - ... Unfortunately the tool quoted in the above