Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [unit-testing]

Unit testing is a method by which individual units of source code are tested to determine if they are fit for use.

-1
votes
2answers
68 views

How to test functionality that only creates input to a large middle-ware dependency

I am a new lead developer that has recently started at a new company, I have been assigned to a project that is trying to consolidate functionality from lots of different applications already in ...
4
votes
1answer
171 views

Boundaries of unit testing between my code and a library or sub-component

Background: I am new to testing in general, and have been studying it in context of JavaScript, specifically React.js, front-end development (actually new to this as well). For the question, I have ...
3
votes
1answer
691 views

What is a good method of storing test data for development and unit testing with angularjs and jasmine?

What is a good method of storing JSON data/objects for development and unit testing with angular and jasmine? I have seen some ways of accomplishing this. However, since I am new to unit testing with ...
0
votes
1answer
120 views

Does it make sense to combine code coverage result for unit test and e2e test

In my company,There is a KPI about code coverage. We measure results by code coverage percentage. So we combine code coverage result of unit test and e2e test together. Is it make sense to do this ?
-1
votes
1answer
39 views

Testing Application Helper that Depends on Controller

I am working on practicing TDD/BDD/ATDD and I am working on a rails application. I created a helper method that depends conditionally on the type of controller being tested. module ApplicationHelper ...
-1
votes
1answer
79 views

writing a database-centric function with test-first

I'm trying to think about the best method to write a function whose primary operation is going to be doing crud on the database. Here's what the overall structure of the function (sans any ...
-1
votes
1answer
1k views

Test Cases in an Interview Setting

In the first cracking the coding interview video Ms. McDowell talks about candidates that begin by writing test cases in whiteboard interviews. How would one go about this? For example, the ...
-6
votes
1answer
644 views

What are the benefits of using Jasmine Framework on existing applications?

I got one project which contains JavaScript code. No unit tests were written for JavaScript code. So it is feasible or beneficial to write unit test cases using Jasmine Framework for code? What are ...
1
vote
0answers
31 views

Integrating Testing with Model Checking

So with Model Checking you have a specification and the model checker automatically goes through your program's states and checks if it matches the specification. What I don't understand is where ...
1
vote
0answers
65 views

Automatic Test Case Generation

I enjoy writing unit tests when building software. Recently I have been learning about Model Checking to help show that a system matches a specification. Now I am returning to testing to see if it has ...
1
vote
0answers
59 views

Unit testing EventArgs - will there be timing issues?

I am writing a small game library. I capsule the logic in my model named Block. My model Block communicates only via events to it's clients (Is this a good thing to do!?). I wrote a simple unit test ...
1
vote
0answers
42 views

Node JS Tape Unit Testing : All cases inside one function for a method

I am using tape for unit testing in Node JS. I wanted to ask one thing about better coding while writing unit testing. When using different inputs to a single method, is it a better idea to use all ...
1
vote
0answers
90 views

writing unit tests for 3rd party applications

Does anyone have any comments on how to write unit tests for 3rd party applications like kamailio...that allow you to write "configuration scripts"? https://www.kamailio.org/wiki/cookbooks/4.0.x/core/...
1
vote
0answers
557 views

Integration test with seed data or programmatically generated objects?

We're having a bit of a discussion in the office about how to implement good integration tests. Example: Account Creation 1. Create User 2. Add Role One case we test is, if there is already a user ...
1
vote
0answers
129 views

How to get verification that you've implemented all your API in a static library?

I just learned that static library building skips the linking stage, which explains why my build process succeeds all the time when it's possible I actually haven't implemented a function in my header....
1
vote
0answers
56 views

Dealing with stubbed external dependency

In sut I should I have two kinds of dependencies to be stubbed: 3rd party dependencies (mongodb & co) and own dependencies: var async = require('async'), // This dependency should not be stubbed ...
1
vote
0answers
551 views

ASP.Net MVC - Implementing a Test Environment

I would like to implement some sort of test environment for ASP.Net projects. I am trying to implement this as an alternative to mocking the entity framework. Here is what I am trying to achieve : ...
1
vote
0answers
4k views

How to verify a method is only called once, with specific arguments (using RhinoMocks)

I'm just starting to use RhinoMocks. Now I'm wondering what test cases I should write. I want to assert that a method is only being called once, with specific arguments. Lets start with my interfaces....
1
vote
0answers
148 views

Mixing newable and injectable in a Callable

I recently read http://misko.hevery.com/2008/09/30/to-new-or-not-to-new/ which discussed newable vs injectable objects. What would you do if you needed to make a Callable that talks to some service ...
1
vote
0answers
451 views

Run RSpec from within a ruby script while refreshing all ruby configs etc

I'm working with a very large project with tons of established tests that include some reasonably complicated environment setups and what not. I've recently run into a situation testing some ...
1
vote
0answers
154 views

Unit Tests for Database Abstraction Layer

I previously asked this question about creating an algorithm for joining records from multiple databases, and since then, I have built a rudimentary version of it (which doesn't allow for inter ...
0
votes
0answers
35 views

How can I test an Express Controller that talks to 3rd party integrations?

I have a simple express server. There is a route that accepts both a NPS score and an email in it's req.params. Here: app.put('/api/nps/:score/:email', npsController.sendIntercomNPS) The actual ...
0
votes
0answers
395 views

C# EntityFramework 6 DbContext and data service with dependency injection

I am refactoring an application that collects and displays measurement data that is stored in a database. Currently I have an interface calleIMeasurementsDataService and an implementation ...
0
votes
0answers
238 views

creating a teartown in integration test by deleting the test database and load the mdf again

I had a Friday developers debate with all my smart colleagues about Tear down process in Integration testing. They are putting a debate that getting a new database mdf file is better while during ...
0
votes
0answers
458 views

Bringing in unit test code with Mocking Frameworks in an established ASP.NET C# software application

Here is the information about my development environment: MongoDB 3.0.0 MongoDB C# Driver Version 1.7.0.4714 Microsoft Visual Studio Professional 2013 .NET Framework 4.0 We are about to do our ...
0
votes
0answers
490 views

What to unit-test when loading a dll?

I wrote a wrapper class that is using a dll. I have a LoadLibrary() function and have wrapped all the functions the dll exports (to match my error codes). I am not too familiar with unit testing. I ...
0
votes
0answers
320 views

Mocking delegate constructors

I am new to Unit Testing in C++. I am supposed to write a Unit test for my code and I am using Google Mock for the same. I have gone through their turtle example. But I am still confused as to how to ...
0
votes
0answers
120 views

Abstract Web API from validation and configuration management in embedded system

Im working with embedded Linux for a router. There is a web GUI for the user to configure router options. When user fill a web form this is submitted to a web server function that is responsible of ...
0
votes
0answers
187 views

How to handle karma/bower in a Symfony Bundle on github?

i am working on a Symfony Bundle that uses angular among other javascript deps. Now i want to unit-test my javascript code and i want to ship those tests as well. My initial idea was to add bower....
0
votes
0answers
124 views

Unit Testing in iOS — Should I split out my Data Model into its own class?

I'm attempting to try out using unit test in for the first time in new iOS activity for work. I love the idea of unit testing, but always find the specifics to be... messy. I get the general ...
-3
votes
0answers
36 views

Is there a term for a catalog of fakes, mocks and stubs that are preconfigured?

Let's say I have a user object... and there are a certain subsection of tests that always for example, want an "admin user" and others want "moderation users" ... or we want users with unicode names ...