tdd

Beginning TDD - Challenges? Solutions? Recommendations? [closed]

邮差的信 提交于 2019-11-27 08:55:27
问题 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 8 years ago . Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not

Disadvantages of Test Driven Development? [closed]

十年热恋 提交于 2019-11-27 08:55:20
问题 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 8 years ago . What do I lose by adopting test driven design? List only negatives; do not list benefits written in a negative form. 回答1: Several

assertEquals(obj,obj) returns a failed test

倖福魔咒の 提交于 2019-11-27 08:40:32
问题 Hmm, I have a money object that allows me to add other money objects into it. I tried assertEquals() in java for testing out if my code if okay, but then it failed. I'm very positive that my code is correct ( System.out.println returns the correct answer), I think I'm just using assertEquals in the wrong manner. T_T What exactly do I use if I want to find out if myObj1 == myObj2 for the tests? **in my test.java** assertEquals(new Money(money1.getCurrency(),new Value(22,70)),money1.add(money2)

Performance testing in Swift using TDD

时光毁灭记忆、已成空白 提交于 2019-11-27 08:04:57
问题 Just learning Test Driven Development in Swift .I created a class that is subclass of XCTestCase in the "ProjectNameTests" group. class BasicFunctionTest: XCTestCase { var values : [Int]? override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample(

Testing asynchronous function with mocha

夙愿已清 提交于 2019-11-27 07:59:50
I want to test a asynchronous javascript function that runs in node.js and makes a simple request to a http api: const HOST = 'localhost'; const PORT = 80; http = require('http'); var options = { host: HOST, port: PORT, path: '/api/getUser/?userCookieId=26cf7a34c0b91335fbb701f35d118c4c32566bce', method: 'GET' }; doRequest(options, myCallback); function doRequest(options, callback) { var protocol = options.port == 443 ? https : http; var req = protocol.request(options, function(res) { var output = ''; res.setEncoding('utf8'); res.on('data', function(chunk) { console.log(chunk); output += chunk;

Rspec: expect vs expect with block - what's the difference?

旧街凉风 提交于 2019-11-27 07:48:02
Just learning rspec syntax and I noticed that this code works: context "given a bad list of players" do let(:bad_players) { {} } it "fails to create given a bad player list" do expect{ Team.new("Random", bad_players) }.to raise_error end end But this code doesn't: context "given a bad list of players" do let(:bad_players) { {} } it "fails to create given a bad player list" do expect( Team.new("Random", bad_players) ).to raise_error end end It gives me this error: Team given a bad list of players fails to create given a bad player list Failure/Error: expect( Team.new("Random", bad_players) ).to

Are there any good TDD tools or resources for VB6?

本秂侑毒 提交于 2019-11-27 07:41:59
Yea i know i'm way behind times but what i've got here is a antique VB6 editor app which i believe that no one will be upgrading to .NET soon. It uses a couple of third party DLLs tools and as it's still using the good old RichEdit control i basically can raise my own Bug farm with just this tool alone. So enough is enough and i'm trying to see if i can use TDD so i can start writing unit test for each behavior/feature that i need to fix, so sooner or later i can have a complete regression test suite for this tool. And even in the future if we do upgrade to .NET i think most of the tests that

BDD And Unit Testing

这一生的挚爱 提交于 2019-11-27 06:52:39
问题 I have been doing TDD and was using it more as unit testing than to drive my design. Recently I have read a lot about BDD; now that I have a better idea about them both, I was trying to figure out how to use BDD and unit testing concurrently. For example I would drive my design using BDD, Dan North style, and lets say I am working on an app and I have a simple spec and I implement it. I have just enough bdd/spec to cover it. Now after I've re-factored it and am happy and it's passed as done

How do you mock a Sealed class?

我们两清 提交于 2019-11-27 06:52:05
Mocking sealed classes can be quite a pain. I currently favor an Adapter pattern to handle this, but something about just keeps feels weird. So, What is the best way you mock sealed classes? Java answers are more than welcome . In fact, I would anticipate that the Java community has been dealing with this longer and has a great deal to offer. But here are some of the .NET opinions: Why Duck Typing Matters for C# Develoepers Creating wrappers for sealed and other types for mocking Unit tests for WCF (and Moq) My general rule of thumb is that objects that I need to mock should have a common

Unit Testing bash scripts

不羁的心 提交于 2019-11-27 06:08:15
We have a system that has some bash scripts running besides Java code. Since we are trying to Test Everything That Could Possibly Break, and those bash scripts may break, we want to test them. The problem is it is hard to test bash scripts. Is there a way or a best practice to test bash scripts? Or should we quit using bash scripts and look for alternative solutions that are testable? ire_and_curses There is actually a shunit2 , an xUnit based unit test framework for Bourne based shell scripts. I haven't used it myself, but it might be worth checking out. Similar questions have been asked