Search Results

Search found 10010 results on 401 pages for 'a b testing'.

Page 80/401 | < Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >

  • Working effectively unit tests / Anyone tried the in-assembly approach?

    - by CodingCrapper
    I'm trying to re-introduce unit testing into my team as our current coverage is very poor. Our system is quite large 40+ projects/assemblies. We current use a project named [SystemName].Test.csproj were all the test code is dumped and organised to represent the namespaces using folders. This approach is not very scalable and makes it difficult to find tests. I've been thinking about added a Tests folder to each project, this would put the unit tests "in the developers face" and make them easy to find. The downside is the Production release code would contain references to nunit, nmocks as well as the test code and test data.... Has anyone tried this approach? How is everyone else working with unit tests on large projects? Having a Tests project per "real" project/assembly would introduce too many new projs. Thanks in advance

    Read the article

  • Seeking recommendations on automated test framework for C

    - by Hissohathair
    I'm writing some code (some of which uses W3C's libwww) in C. It's been a while since I've touched ANSI C. Back in the day we rolled our own test framework. Does anybody here have any test frameworks that they recommend for C programming? Googling around I was inclined to go with Check. It has a page on other unit testing frameworks in C, a few of which I've taken a quick look at. GNU AutoUnit seemed like it might be a good choice since I'm using the GNU build tools (autoconf, automake) but it doesn't look that alive... Another option would be to use a C++ framework and just write my tests in C++ Anyway, any experienced opinions would be appreciated. Thanks.

    Read the article

  • Custom annotations to configure tests

    - by ace
    First of al let me start off by saying I think custom annotations can be used for this but i'm not totally sure. I would like to have a set of annotations that I can decorate some test classes with. The annotations would allow me to configure the test for different environments. Example: public class Atest extends BaseTest{ private String env; @Login(environment=env) public void testLogin(){ //do something } @SignUp(environment=env) public void testSignUp(){ //do something } } The idea here would be that the login annotation would then be used to lookup the username and password to be used in the testLogin method for testing a login process for a particular environment. So my question(s) is this possible to do with annotations? If so I have not been able to find a decent howto online to do something like this. Everything out there seems to be your basic here's how to do your custom annotations and a basic processor but I haven't found anything for a situation like this. Ideas?

    Read the article

  • Can this loop be sped up in pure Python?

    - by Noctis Skytower
    I was trying out an experiment with Python, trying to find out how many times it could add one to an integer in one minute's time. Assuming two computers are the same except for the speed of the CPUs, this should give an estimate of how fast some CPU operations may take for the computer in question. The code below is an example of a test designed to fulfill the requirements given above. This version is about 20% faster than the first attempt and 150% faster than the third attempt. Can anyone make any suggestions as to how to get the most additions in a minute's time span? Higher numbers are desireable. EDIT: This experiment is being written in Python 3.1 and is 15% faster than the fourth speed-up attempt. def start(seconds): import time, _thread def stop(seconds, signal): time.sleep(seconds) signal.pop() total, signal = 0, [None] _thread.start_new_thread(stop, (seconds, signal)) while signal: total += 1 return total if __name__ == '__main__': print('Testing the CPU speed ...') print('Relative speed:', start(60))

    Read the article

  • Facebook Api - Local development, Testserver, Liveserver ... How?

    - by Thijs Kaspers
    I'm working on a new website that uses the Facebook API for users to login and several implementations of the graph Api. My workflow usually is: Development on localhost Development using MAMP/XAMPP or similar software Push to server - testing domain A team of people can test the changes for a few days to see if everything works as planned. Push to server - live domain Changes are live for public Facebook uses the site URL in the appsettings and for security reasons, they will only redirect to that url... Problem is.. I have localhost and 2 different domains. How can I make this work? Ofcourse I could edit the hostsfile, but that only fixes it for localhost.. Still no solution for the testdomain. Please tell me this is somehow possible! I'm getting more and more depressed with the Facebook API.

    Read the article

  • Expected specifier-qualifier-list before 'CGPoint'

    - by Rob
    My project compiles and runs fine unless I try to compile my Unit Test Bundle it bombs out on the following with an "Expected specifier-qualifier-list before 'CGPoint'" error on line 5: #import <Foundation/Foundation.h> #import "Force.h" @interface WorldObject : NSObject { CGPoint coordinates; float altitude; NSMutableDictionary *forces; } @property (nonatomic) CGPoint coordinates; @property (nonatomic) float altitude; @property (nonatomic,retain) NSMutableDictionary *forces; - (void)setObject:(id)anObject inForcesForKey:(id)aKey; - (void)removeObjectFromForcesForKey:(id)aKey; - (id)objectFromForcesForKey:(id)aKey; - (void)applyForces; @end I have made sure that my Unit Test Bundle is a target of my WorldObject.m and it's header is imported in my testing header: #define USE_APPLICATION_UNIT_TEST 1 #import <SenTestingKit/SenTestingKit.h> #import <UIKit/UIKit.h> #import "Force.h" #import "WorldObject.h" @interface LogicTests : SenTestCase { Force *myForce; WorldObject *myWorldObject; } @end

    Read the article

  • Firefox - Stashing Requests for Deliberate Resubmission to Django App

    - by Koobz
    I've got an object creation form that's somewhat complicated, it contains a few dynamic formsets etc. I'm trying to ensure that these dynamic formsets are intact if the form runs into an error and returns you to the given page. In cases like this, the refresh button actually works well in re-submitting the request, but I can't rely on it. I'm doing some ad-hoc testing in the browser that I'd like to make a bit more repeatable, and eventually move to a unit test using Django's mock client. Is there an extension, or some convenient method to stash requests for later re-submission. The goal: I resubmit the request, tweak the code, eyeball the results, rinse and repeat. Three days later I can come back to it an try it again to make sure it's still working. The closest thing I can think of in this case is simply recording my activity with Selenium ide and replaying it.

    Read the article

  • Getting Assert to work in Visual C++ Unit Tests?

    - by garsh0p
    I'm using Visual Studio 2008's built in testing framework in my Visual C++ project. I'm adding a new Test Project, then a new Unit Test. However, I can't use any of the functions provided by Assert. Assert shows up in the Intellisense, but I can't do anything with it. I've done unit tests fine in Visual C#. Am I forgetting to do anything? EDIT: There isn't much code because everything I'm doing is auto-generated by Visual Studio 2008. Here are the steps I'm doing: File - New Project - Visual C++ - General - Empty Project Right click solution in Solution Explorer - Add - New Project... Visual C++ - Test - Test Project Open UnitTest1.cpp (auto-generated) Go to TestMethod1() From here, when I try to use the Assert class (like Assert.AreEqual), I can't do it. If I do the same in a Visual C# project, it works fine.

    Read the article

  • Is my code really not unit-testable?

    - by John
    A lot of code in a current project is directly related to displaying things using a 3rd-party 3D rendering engine. As such, it's easy to say "this is a special case, you can't unit test it". But I wonder if this is a valid excuse... it's easy to think "I am special" but rarely actually the case. Are there types of code which are genuinely not suited for unit-testing? By suitable, I mean "without it taking longer to figure out how to write the test than is worth the effort"... dealing with a ton of 3D math/rendering it could take a lot of work to prove the output of a function is correct compared with just looking at the rendered graphics.

    Read the article

  • Working effectively with unit tests / Anyone tried the in-assembly approach?

    - by CodingCrapper
    I'm trying to re-introduce unit testing into my team as our current coverage is very poor. Our system is quite large 40+ projects/assemblies. We current use a project named [SystemName].Test.csproj were all the test code is dumped and organised to represent the namespaces using folders. This approach is not very scalable and makes it difficult to find tests. I've been thinking about added a Tests folder to each project, this would put the unit tests "in the developers face" and make them easy to find. The downside is the Production release code would contain references to nunit, nmocks as well as the test code and test data.... Has anyone tried this approach? How is everyone else working with unit tests on large projects? Having a Tests project per "real" project/assembly would introduce too many new projs. Thanks in advance

    Read the article

  • What was the most productive improvement suggestion you ever made for your team

    - by questzen
    I suggested the testing and functional teams to use Freemind map for jotting the functional flows and test steps. There was some paranoia but our module took it up and the QA teams were surprised to see near zero review comments. There was misconception among the team that there are doing more work. I assured them that by the time others would complete their work along with comment fixes, we would be going out for team lunchs and we did. The real returns came when the developers started refering to the created document in their discussions. So share your contribution(s).

    Read the article

  • Using content from the project in tests

    - by oillio
    I am working with Visual Studio 2010 and it's integrated testing functionality. I have an XML file in my project which is set to copy to the output directory. I can access the file just fine when I compile and run the project. But it doesn't exist when I attempt to access it within a TestMethod. It looks like the test is run with the working directory set to an "Out" directory created within the TestResults directory. I can set a breakpoint before I use the file. If I then copy the file into this "Out" directory and continue running the test it accesses the file properly. But that is not really how I want my automated tests to function. Is it possible to tell VS to copy the build directory into this working directory?

    Read the article

  • How do we name test methods where we are checking for more than one condition?

    - by Sandbox
    I follow the technique specified in Roy Osherove's The Art Of Unit Testing book while naming test methods - MethodName_Scenario_Expectation. It suits perfectly well for my 'unit' tests. But,for tests that I write in 'controller' or 'coordinator' class, there isn't necessarily a method which I want to test. For these tests, I generate multiple conditions which make up one scenario and then I verify the expectation. For example, I may set some properties on different instances, generate an event and then verify that my expectation from controller/coordinator is being met. Now, my controller handles events using a private event handler. Here my scenario is that, I set some properties, say 3 condition1,condition2 and condition3 Also, my scenario includes an event is raised I don't have a method name as my event handler is private. How do I name such a test method?

    Read the article

  • Free Tool(s) / Tips to assist me in filling out forms on Win7?

    - by MedicineMan
    I am doing some web development on some long forms. There are many fields for me to fill out to get through the form. Instead of typing out the same things every time (contact information, address, business information) I'm hoping there is some tool out there / combination of tools that will assist me in filling this out. Requirements: I am doing development / testing in FF, IE, and Chrome on a Win 7 system, so the tool would leverage one of those platforms. Oh yeah, one more thing: It's got to be free and lightweight, otherwise, I'd rather just type out responses to the form fields.

    Read the article

  • Unit Test this - Simple method but don't know what's to test!

    - by user309705
    a very simple method, but don't know what's to test! I'd like to test this method in Business Logic Layer, and the _dataAccess apparently is from data layer. public DataSet GetLinksByAnalysisId(int analysisId) { DataSet result = new DataSet(); result = _dataAccess.SelectAnalysisLinksOverviewByAnalysisId(analysisId); return result; } All Im testing really is to test _dataAccess.SelectAnalysisLinksOverviewByAnalysisId() is get called! here's my test code (using Rhino mock) [TestMethod] public void Test() { var _dataAccess = MockRepository.GenerateMock<IDataAccess>(); _dataAccess.Expect(x => x.SelectAnalysisLinksOverviewByAnalysisId(_settings.UserName, 0, out dateExecuted)); var analysisBusinessLogic = new AnalysisLinksBusinessLogic(_dataAccess); analysisBusinessLogic.GetLinksByAnalysisId(_settings, 0); _dataAccess.VerifyAllExpectations(); } Let me know if you writing the test for this method what would you test against? Many Thanks!

    Read the article

  • how to find out how much application memory django process is (or will be) taking?

    - by photographer
    There are different "Application memory" options (like 80MB...200MB) in django-friendly hosting called webfaction and I'm confused deciding which one I should buy. Could someone please walk me through the ideas on how to figure out how much memory my project might require (excluding operating system, the main apache server and the database servers memory requirements)? I understand in theory I'll need to perform some kind of load testing, but thought there might be ways to calculate that in advance with some simple/relatively easy understandable approach. I don't know how hard they enforce application memory usage limit, and another question is: what will happen if more users came to the site and more threads started than what I expected? Will the application crash? Or will delays just become uncomfortable? And - no, application is not ready yet (I can't measure anything right now). Development environment if it matters is Winodows 7, 64-bit. Hosting itself is some kind of Linux I think. (Sorry if it's not a stackoverflow question.)

    Read the article

  • PHP: Simulate multiple MySQL connections to same database

    - by Varun
    An insert query is constantly getting logged in my MySQL slow query log. I want to see how much time the INSERT query is taking with 100 simultaneous insert operations(to the same table). So I need to simulate the follwoing. 500 different simultaneous connections from PHP to the same database on a mysql server, all of which are inserting a row(simultaneously) to the same table. DO I need to use any load testing tool? Or Can I simply write a PHP script to do this? Any thoughts?

    Read the article

  • How to run xunit in Visual Studio 2012?

    - by user1978421
    I am very new to unit testing. I have been following the procedures for creating a unit test in visual studio 2012 on http://channel9.msdn.com/Events/TechEd/Europe/2012/DEV214. The test just won't start. And it will prompt me "A project with an Output Type of Class Library cannot be started directly. In order to debug this project, add an executable project to this solution which references the library project. Set an executable project as the startup project. Even though I attached the unit test class code to a console program, the test does not start and the test explorer is empty. In the video, it doesn't need to have any running program. The lady only created a class library, and the test will run. what should I do? Note. there is no "create unit test" on the mouse right click menu

    Read the article

  • Write Unit test for sorting

    - by user175084
    I need to write a unit test for a method where I arrange data according to another default list. This is the method. internal AData[] GetDataArrayInInitialSortOrder(ABData aBData) { Dictionary<string,AData > aMap = aBData.ADataArray.ToDictionary(v => v.GroupName, v => v); List<AData> newDataList = new List<AData>(); foreach (AData aData in _viewModel.ADList) newDataList.Add(aMap[aData.GroupName]); return newDataList.ToArray(); } Please help I am new in unit testing and this is not easy for me. Any sample or links are appreciated Thanks

    Read the article

  • How does SWTBOT run a custom eclipse based application? I don't know how to specify my target application

    - by jlisam13
    I have an eclipse based application. I have heard of swtbot however I am having a hard time understanding how exactly does this tool run my application and how would I specify that. This eclipse based application has an executable and various configuration/plugin/features files. I have done the tutorials about swtbot and I have successfully completed them but they all just create a template application to test on. Is this even possible? If not do you guys have any alternatives for UI automation testing on eclipse based apps? Thanks.

    Read the article

  • Visual Studio 2010 Not Recognizing Unit Test

    - by jmease
    In an existing solution I added a new Test Project. In my Test Project .cs file I have a class decorated with the [TestClass] attribute and a method decorated with the [TestMethod] attribute. I have verified that in Configuration Manager the build check box is checked for the Test Project (as my google search has revealed was the problem for others with this issue). I have set Test Project as my start up project for the solution. When I try to start the test I get "Can not start test project because the project does not contain any tests". I am really new to unit testing. What am I missing?

    Read the article

  • How to test Guice Singleton?

    - by 01
    Guice Singletons are weird for me First I thought that IService ser = Guice.createInjector().getInstance(IService.class); System.out.println("ser=" + ser); ser = Guice.createInjector().getInstance(IService.class); System.out.println("ser=" + ser); will work as singleton, but it returns ser=Service2@1975b59 ser=Service2@1f934ad its ok, it doesnt have to be easy. Injector injector = Guice.createInjector(); IService ser = injector.getInstance(IService.class); System.out.println("ser=" + ser); ser = injector.getInstance(IService.class); System.out.println("ser=" + ser); works as singleton ser=Service2@1975b59 ser=Service2@1975b59 So i need to have static field with Injector(Singleton for Singletons) how do i pass to it Module for testing?

    Read the article

  • What is the role of asserts in C++ programs that have unit tests?

    - by lhumongous
    Greetings, I've been adding unit tests to some legacy C++ code, and I've run into many scenarios where an assert inside a function will get tripped during a unit test run. A common idiom that I've run across is functions that take pointer arguments and immediately assert if the argument is NULL. I could easily get around this by disabling asserts when I'm unit testing. But I'm starting to wonder if unit tests are supposed to alleviate the need for runtime asserts. Is this a correct assessment? Are unit tests supposed to replace runtime asserts by happening sooner in the pipeline (ie: the error is caught in a failing test instead of when the program is running). On the other hand, I don't like adding soft fails to code (eg: if(param == NULL) return false;). A runtime assert at least makes it easier to debug a problem in case a unit test missed a bug. Thanks!

    Read the article

  • How can I change ruby log level in unit tests based on context

    - by Stuart
    I'm new to ruby so forgive me if this is simple or I get some terminology wrong. I've got a bunch of unit tests (actually they're integration tests for another project, but they use ruby test/unit) and they all include from a module that sets up an instance variable for the log object. When I run the individual tests I'd like log.level to be debug, but when I run a suite I'd like log.level to be error. Is it possible to do this with the approach I'm taking, or does the code need to be restructured? Here's a small example of what I have so far. The logging module: #!/usr/bin/env ruby require 'logger' module MyLog def setup @log = Logger.new(STDOUT) @log.level = Logger::DEBUG end end A test: #!/usr/bin/env ruby require 'test/unit' require 'mylog' class Test1 < Test::Unit::TestCase include MyLog def test_something @log.info("About to test something") # Test goes here @log.info("Done testing something") end end A test suite made up of all the tests in its directory: #!/usr/bin/env ruby Dir.foreach(".") do |path| if /it-.*\.rb/.match(File.basename(path)) require path end end

    Read the article

  • Are multiple asserts bad in a unit test? Even if chaining?

    - by Michael Haren
    Is there anything wrong with checking so many things in this unit test?: ActualModel = ActualResult.AssertViewRendered() // check 1 .ForView("Index") // check 2 .WithViewData<List<Page>>(); // check 3 CollectionAssert.AreEqual(Expected, ActualModel); // check 4 The primary goals of this test are to verify the right view is returned (check 2) and it contains the right data (check 4). Would I gain anything by splitting this into multiple tests? I'm all about doing things right, but I'm not going to split things up if it doesn't have practical value. I'm pretty new to unit testing, so be gentle.

    Read the article

< Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >