tdd

Continuous testing with IntelliJ Idea

会有一股神秘感。 提交于 2019-12-02 21:09:00
I'm looking for an IntelliJ IDEA plugin that would run my tests each time I change my code. I looked for such a solution and I found: Infinitest , which works, but is inconvenient because I need to add the facet to each module, and it opens a new tool window for each module (which means 15 tool windows for me). Fireworks - didn't work for me, maybe it just doesn't work with IDEA 14 (in its repo I can see that last changes were made in 2009). IntelliJ also reports that it throws exceptions. There are lots of ways I could run all my tests (including writing a simple script for this), but I'm

Why should I use Test Driven Development? [duplicate]

会有一股神秘感。 提交于 2019-12-02 21:05:34
This question already has answers here : Is it worth to start TDD? [duplicate] Why should I practice Test Driven Development and how should I start? (4 answers) Duplicate: Why should I practice Test Driven Development and how should I start? For a developer that doesn't know about Test-Driven Development, what problem(s) will be solved by adopting TDD? [EDIT] Let's assume that the developer already (ab)uses a unit testing framework. Here are three reasons that TDD might help a developer/team: Better understanding of what you're going to write Enforces the policy of writing tests a little

Best practices for HttpContext and testable controllers in ASP.Net MVC

◇◆丶佛笑我妖孽 提交于 2019-12-02 21:04:19
Update: Based on a couple of the answers I have received, I just want to make clear that I am well aware how to go about mocking HttpContext using a mocking framework. I am more interested knowing what the pros and cons of mocking HttpContext are when compared to using wrapper classes around HttpContext. I'm looking for opinions on how to deal with HttpContext when building testable controllers in ASP.Net MVC. After reading up on it there seems to be two schools of thought - either build off of HttpContextBase and use a mocking framework to generate the needed stubs/mocks for your unit testing

How do you run your unit tests? Compiler flags? Static libraries?

╄→гoц情女王★ 提交于 2019-12-02 20:50:05
I'm just getting started with TDD and am curious as to what approaches others take to run their tests. For reference, I am using the google testing framework, but I believe the question is applicable to most other testing frameworks and to languages other than C/C++. My general approach so far has been to do one of three things: Write the majority of the application in a static library, then create two executables. One executable is the application itself, while the other is the test runner with all of the tests. Both link to the static library. Embed the testing code directly into the

First Shot at Testing Laravel 4 apps (PHPSpec/BDD vs. PHPUnit/TDD)

删除回忆录丶 提交于 2019-12-02 20:47:47
I have been wrestling with this question for far too long now. I know I need to just jump into one or the other since they are both obviously viable/useful tools, but have been stuck on the fence, researching both, for weeks. PHPUnit vs. PHPSpec - Which one may lead to better long-term maintainability and programming practices? I have talked to several seasoned PHPUnit -> PHPspec converts/users who now swear by PHPspec, claiming that it promotes better design thanks to its BDD approach. However, since it is a much newer tool there is a lack of community/tutorials in comparison with PHPUnit.

nodejs mocha suite is not defined error

≯℡__Kan透↙ 提交于 2019-12-02 20:17:06
I am trying to run some tests using mocha but cant seem to get over this error. E:\tdd\nodejs\cart>mocha cart.test.js node.js:201 throw e; // process.nextTick error, or 'err ^ ReferenceError: suite is not defined at Object.<anonymous> (E:\tdd\nodejs\cart\cart.test.js:5:1 at Module._compile (module.js:432:26) at Object..js (module.js:450:10) at Module.load (module.js:351:31) at Function._load (module.js:310:12) at Module.require (module.js:357:17) at require (module.js:368:17) at C:\Users\lex\AppData\Roaming\npm\node_module at Array.forEach (native) at load (C:\Users\lex\AppData\Roaming\npm

App.config in Test Projects

北战南征 提交于 2019-12-02 20:07:01
I'm building an ASP.NET app in VS2010. I have a number of separate assemblies (class libraries) and corresponding Test projects for each. In one of the class libraries I use an App.config file to store settings. The assembly itself uses the following code to retrieve settings: string tmp = ConfigurationManager.AppSettings["mySetting"]; The problem is that when I try to create a Unit Test in a separate test project, the test does not pick up the setting in the App.config file. If I COPY the App.config file into the Test project, it works. How can I ensure that each assembly uses its own copy of

How to (unit-)test data intensive PL/SQL application

爷,独闯天下 提交于 2019-12-02 19:40:32
Our team is willing to unit-test a new code written under a running project extending an existing huge Oracle system. The system is written solely in PL/SQL, consists of thousands of tables, hundreds of stored procedures packages, mostly getting data from tables and/or inserting/updating other data. Our extension is not an exception. Most functions return data from a quite complex SELECT statementa over many mutually bound tables (with a little added logic before returning them) or make transformation from one complicated data structure to another (complicated in another way). What is the best

Philisophical Questions about Test-Driven Development

对着背影说爱祢 提交于 2019-12-02 19:14:02
I have been perpetually intrigued by test-driven development, but I can never follow through with it when I try it on real projects. I have a couple of philosophical questions that continually arise when I try it: How do you handle large changes? When it comes to testing single functions (some parameters, a result value, few side effects), TDD is a no-brainer. But what about when you need to thoroughly overhaul something large, e.g. switching from a SAX parsing library to a DOM parsing library? How do you keep to the test-code-refactor cycle when your code is in an intermediate state? Once you

How to deal with interface overuse in TDD?

萝らか妹 提交于 2019-12-02 19:03:19
I've noticed that when I'm doing TDD it often leads to a very large amount of interfaces. For classes that have dependencies, they are injected through the constructor in the usual manner: public class SomeClass { public SomeClass(IDependencyA first, IDependency second) { // ... } } The result is that almost every class will implement an interface. Yes, the code will be decoupled and can be tested very easily in isolation, but there will also be extra levels of indirection that just makes me feel a little...uneasy. Something doesn't feel right. Can anyone share other approaches that doesn't