tdd

Learning OpenGL while practicing TDD (unit testing)

徘徊边缘 提交于 2020-01-01 01:16:09
问题 I have started a new game project, and have decided to learn and use OpenGL for it (project is being simultaneously developed on Windows and Linux). At the same time, I am also very interested in Test Driven Development, and am trying to put my best effort into writing my unit tests to lead design before any actual code. However, I think my lack of knowledge might be tripping me up, and I keep hitting a wall in trying to write my unit tests for the "rendering" parts of the codebase. I'm

RSpec: how do I write a test that expects certain output but doesn't care about the method?

早过忘川 提交于 2019-12-31 20:14:29
问题 I'm trying to get my head around test-driven design, specifically RSpec. But I'm having trouble with some of the examples from The RSpec Book. In the book, we test for output on $STDOUT like this: output = double('output') game = Game.new output.should_receive(:puts).with('Welcome to Codebreaker!') game.start() Well, that works after a fashion. But why on earth should I care if the Game object uses the puts() method? If I change it to print(), should it really break the test? And, more

Is unit testing a bad idea during beta/prototyping?

删除回忆录丶 提交于 2019-12-31 18:51:11
问题 A new project we began introduced a lot of new technologies we weren't so familiar with, and an architecture that we don't have a lot of practice in. In other words, the interfaces and interactions between service classes etc of what we're building are fairly volatile, even more so due to internal and customer feedback. Though I've always been frustrated by the ever-moving specification, I see this to some degree a necessary part of building something we've never built before - if we just

Integration testing frameworks for testing a distributed system?

我的梦境 提交于 2019-12-31 13:14:53
问题 I have a distributed system with components spread across multiple boxes. They talk to each other using tcp or multicast. Each components interchanges messages with each other - these are basically data structures that get serialized. What integration test frameworks do we have for testing systems like these? I am familiar with ruby so something ruby based would definitely help. 回答1: I suppose there are different ways of doing it. I try to avoid integration testing as much as I can but at

Integration testing frameworks for testing a distributed system?

大憨熊 提交于 2019-12-31 13:14:22
问题 I have a distributed system with components spread across multiple boxes. They talk to each other using tcp or multicast. Each components interchanges messages with each other - these are basically data structures that get serialized. What integration test frameworks do we have for testing systems like these? I am familiar with ruby so something ruby based would definitely help. 回答1: I suppose there are different ways of doing it. I try to avoid integration testing as much as I can but at

How does TDD make refactoring easier?

喜欢而已 提交于 2019-12-31 10:02:16
问题 I've heard that projects developed using TDD are easier to refactor because the practice yields a comprehensive set of unit tests, which will (hopefully) fail if any change has broken the code. All of the examples I've seen of this, however, deal with refactoring implementation - changing an algorithm with a more efficient one, for example. I find that refactoring architecture is a lot more common in the early stages where the design is still being worked out. Interfaces change, new classes

C# Service Layer Design Pattern

你说的曾经没有我的故事 提交于 2019-12-31 08:52:31
问题 We are looking into creating a new project and are wanting to explore using the Repository and Service layer patterns, the aim to is create loosely coupled code which is fully testable using mock repositories. Please see below the basic architecture idea. We will be using interfaces to describe the repositories and inject these into the service layers to remove any dependencies. Then using autofac we will wire up the services at runtime. public interface IOrderRepository { IQueryable<Order>

C# Service Layer Design Pattern

℡╲_俬逩灬. 提交于 2019-12-31 08:51:52
问题 We are looking into creating a new project and are wanting to explore using the Repository and Service layer patterns, the aim to is create loosely coupled code which is fully testable using mock repositories. Please see below the basic architecture idea. We will be using interfaces to describe the repositories and inject these into the service layers to remove any dependencies. Then using autofac we will wire up the services at runtime. public interface IOrderRepository { IQueryable<Order>

C# Service Layer Design Pattern

╄→尐↘猪︶ㄣ 提交于 2019-12-31 08:51:46
问题 We are looking into creating a new project and are wanting to explore using the Repository and Service layer patterns, the aim to is create loosely coupled code which is fully testable using mock repositories. Please see below the basic architecture idea. We will be using interfaces to describe the repositories and inject these into the service layers to remove any dependencies. Then using autofac we will wire up the services at runtime. public interface IOrderRepository { IQueryable<Order>

Is there a python equivalent for RSpec to do TDD?

蹲街弑〆低调 提交于 2019-12-31 08:28:50
问题 I'm looking for a test framework like Ruby's RSpec to do test driven development in Python. The advantage of a framework like RSpec is that it offers a DSL that lends itself well to TDD. First you describe the test in english, and then you write the test, and when it fails you get a message saying what test failed with your nice description of what the test is trying to do. So far I've looked at PyTest and Nose. PyTest seems closer to ruby's MiniTest than RSpec. Instead of offering a DSL with