Search Results

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

Page 60/401 | < Previous Page | 56 57 58 59 60 61 62 63 64 65 66 67  | Next Page >

  • How do you tell that your unit tests are correct?

    - by Jacob Adams
    I've only done minor unit testing at various points in my career. Whenever I start diving into it again, it always troubles me how to prove that my tests are correct. How can I tell that there isn't a bug in my unit test? Usually I end up running the app, proving it works, then using the unit test as a sort of regression test. What is the recommended approach and/or what is the approach you take to this problem? Edit: I also realize that you could write small, granular unit tests that would be easy to understand. However, if you assume that small, granular code is flawless and bulletproof, you could just write small, granular programs and not need unit testing. Edit2: For the arguments "unit testing is for making sure your changes don't break anything" and "this will only happen if the test has the exact same flaw as the code", what if the test overfits? It's possible to pass both good and bad code with a bad test. My main question is what good is unit testing since if your tests can be flawed you can't really improve your confidence in your code, can't really prove your refactoring worked, and can't really prove that you met the specification?

    Read the article

  • How do you prove a function works?

    - by glenn I.
    I've recently gotten the testing religion and have started primarily with unit testing. I code unit tests which illustrate that a function works under certain cases, specifically using the exact inputs I'm using. I may do a number of unit tests to exercise the function. Still, I haven't actually proved anything other than the function does what I expect it to do under the scenarios I've tested. There may be other inputs and scenarios I haven't thought of and thinking of edge cases is expensive, particularly on the margins. This is all not very satisfying to do me. When I start to think of having to come up with tests to satisfy branch and path coverage and then integration testing, the prospective permutations can become a little maddening. So, my question is, how can one prove (in the same vein of proving a theorem in mathematics) that a function works (and, in a perfect world, compose these 'proofs' into a proof that a system works)? Is there a certain area of testing that covers an approach where you seek to prove a system works by proving that all of its functions work? Does anybody outside of academia bother with an approach like this? Are there tools and techniques to help? I realize that my use of the word 'work' is not precise. I guess I mean that a function works when it does what some spec (written or implied) states that it should do and does nothing other than that. Note, I'm not a mathematician, just a programmer.

    Read the article

  • Problems with data driven testing in MSTest

    - by severj3
    Hello, I am trying to get data driven testing to work in C# with MSTest/Selenium. Here is a sample of some of my code trying to set it up: [TestClass] public class NewTest { private ISelenium selenium; private StringBuilder verificationErrors; [DeploymentItem("GoogleTestData.xls")] [DataSource("System.Data.OleDb", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=GoogleTestData.xls;Persist Security Info=False;Extended Properties='Excel 8.0'", "TestSearches$", DataAccessMethod.Sequential)] [TestMethod] public void GoogleTest() { selenium = new DefaultSelenium("localhost", 4444, "*iehta", http://www.google.com); selenium.Start(); verificationErrors = new StringBuilder(); var searchingTerm = TestContext.DataRow["SearchingString"].ToString(); var expectedResult = TestContext.DataRow["ExpectedTextResults"].ToString(); Here's my error: Error 3 An object reference is required for the non-static field, method, or property 'Microsoft.VisualStudio.TestTools.UnitTesting.TestContext.DataRow.get' E:\Projects\SeleniumProject\SeleniumProject\MaverickTest.cs 32 33 SeleniumProject The error is underlining the "TestContext.DataRow" part of both statements. I've really been struggling with this one, thanks!

    Read the article

  • Testing VSTO Applications?

    - by Matthew Sposato
    I'm developing an Word 2007 VSTO application in VS2008. The part of the application that interacts with VSTO is difficult to test. VSTO objects behave differently than most class libraries. Their state and behaviors depend on how the user is interacting with Word, where they clicked, what's around the insertion point, etc. Mock objects could work in some scenarios, but they don't capture many of the subtleties of the VSTO objects. Anyone have any experience with testing VSTO based application they can share?

    Read the article

  • TFS Load Testing Web Tests

    - by durilai
    I am configuring a load test and am curious/confused on settings. I am testing an intranet website, that is expected to have 6000 concurrent users. My employer had some previous consultant tell them that the load test users does not matter and that we need to worry about requests/second. They have previously determined that those 6000 users would generate 30 rps, while I feel that is not correct we need to show that we can exceed that number. The previous load test was set for only 200 users and the results showed that it did exceed the 200 rps. They were happy with the results, but that is not how I understand this. My question is, if we need to support 6000 concurrent users should I just set my users to 6000 and run, or is the rps an adequate piece of data to rely on? Any help is appreciated. Thanks

    Read the article

  • Java and junit: derivative of polynomial method testing issue

    - by Curtis
    Hello all, im trying to finish up my junit testing for finding the derivative of a polynomial method and im having some trouble making it work. here is the method: public Polynomial derivative() { MyDouble a = new MyDouble(0); MyDouble b = this.a.add(this.a); MyDouble c = this.b; Polynomial poly = new Polynomial (a, b, c); return poly; } and here is the junit test: public void testDerivative() { MyDouble a = new MyDouble(2), b = new MyDouble(4), c = new MyDouble(8); MyDouble d = new MyDouble(0), e = new MyDouble(4), f = new MyDouble(4); Polynomial p1 = new Polynomial(a, b, c); Polynomial p2 = new Polynomial(d,e,f); assertTrue(p1.derivative().equals(p2)); } im not too sure why it isnt working...ive gone over it again and again and i know im missing something. thank you all for any help given, appreciate it

    Read the article

  • Testing an XQuery Transformation

    - by hakish
    Hi, I'm using Workshop for Weblogic and I'm testing an XQuery Transformation. Both MFL and XSD are valid. But the XQuery doesn't seem to work... it gives me this error: Error occurred while executing XQuery: loader constraint violation: when resolving method "javax.xml.stream.XMLInputFactory.createXMLStreamReader(Ljava/io/Reader;)Ljavax/xml/stream/XMLStreamReader;" the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) of the current class, weblogic/xml/query/parsers/StAXCursorAdaptor, and the class loader (instance of ) for resolved class, javax/xml/stream/XMLInputFactory, have different Class objects for the type javax/xml/stream/XMLStreamReader used in the signature Have you ever seen this before? How can I solve this please?

    Read the article

  • Django: testing get query

    - by Brant
    Okay, so I am sick of writing this... res = Something.objects.filter(asdf=something) if res: single = res[0] else: single = None if single: # do some stuff I would much rather be able to do something like this: single = Something.objects.filter(asdf=something) if single: #do some stuff I want to be able to grab a single object without testing the filtered results. In other words, when i know there is either going to be 1 or 0 matching entries, I would like to jump right to that entry, otherwise just get a 'None'. The DoesNotExist error that goes along with .get does not always work so well when trying to compress these queries into a single line. Is there any way to do what I have described?

    Read the article

  • testing SpringMVC controllers

    - by Don
    Hi, I'm unit-testing my SpringMVC (v. 2.5) controllers using code like the following: public void testParamValidation() { MyController controller = new MyController(); MockHttpServletRequest request = new MockHttpServletRequest(); request.addParameter("foo", "bar"); request.addParameter("bar", baz"); ModelAndView mav = controller .handleRequest(request, new MockHttpServletResponse()); // Do some assertions on mav } This controller is a subclass of AbstractCommandController, so the parameters are bound to a command bean, and any binding or validation errors are stored in an object that implements the Errors interface. I can't seem to find any way to access this Errors from within the test, is this possible? Thanks, Don

    Read the article

  • Testing MPMoviePlayerViewController in iPad simulator

    - by hgpc
    I have a view that shows a MPMoviePlayerViewController modally. When testing it in the iPad simulator it works well on the first try. If I dismiss the video and then show the view again, the player only plays the audio, but not the video. Is this a simulator quirk or am I doing something wrong? Here's my code: - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; MPMoviePlayerViewController* v = [[MPMoviePlayerViewController alloc] initWithContentURL:url]; [[NSNotificationCenter defaultCenter] addObserver:self selector: @selector(playbackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:v.moviePlayer]; [self presentMoviePlayerViewControllerAnimated:v]; [v release]; } -(void) playbackDidFinish:(NSNotification*)aNotification { MPMoviePlayerController *player = [aNotification object]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:player]; [player stop]; [self dismissMoviePlayerViewControllerAnimated]; }

    Read the article

  • Automation of testing using JUnit

    - by Vijay Selvaraj
    Hi, i am trying to automate manual testing of modules in my project. We are dealing with IBM Websphere Message queue software. We have a trigger component written in core java which when executed polls for availability of message in the configured queue. Its an indefinite while loop that keeps the trigger component running. I have written test cases in JUnit to put message in the queue and now will i be able to start/stop the trigger component on demand? Invoking the trigger component keeps it running and i am not getting the control back to check the expected output. If i start it in thread then the log files to which the trigger component is supposed to update when processing the message is not getting updated. How can i resolve this situation. Your suggestion and directions is highly appreciated. Thanks, -Vijay

    Read the article

  • htaccess rewrite issue while testing on localhost

    - by James Doc
    I'm running OSX (10.6) with Apache with .htaccess enabled. In the htaccess file I have the code: Options +FollowSymlinks RewriteEngine on RewriteRule ^page/([A-Z0-9._%+-]+) index.php?page=$1 [NC] This runs perfectly on my external server and redirects nicely to index.php?page=whatever However when testing locally from localhost/~james/In%20Progress/Vila%20Maninga/page/whatever I get redirected to localhost/~james/Users/James/Sites/In%20Progress/Vila%20Maninga/index.php?page=whatever. For some reason 'Users/James/Sites/' is being added. Does anyone why this is happening and how to prevent it? Many thanks, James

    Read the article

  • Django on Dreamhost - testing/sand box environment

    - by elequ
    I've been using webfaction for all my django needs for the last couple of years but have had a high traffic site fall in my lap that dreamhost are probably better suited to handling. To set up and experiment with a site with webfaction there are your [user].webfactional.com accounts. Which is sweet. Equivalently Dreamhost also offers [name].dreamhosters.com Yet this doesn't seem to work with my database and this doesn't seem to be playing nice with setting up django or passenger_wsgi. So I'm wondering if I'm interpreting the documentation correctly to suggest that in order to make a site that depends on passenger it needs to be running from an active domain. The documentation is really implicit, I'm baffled. Has anyone set up a testing/sand box environment for django using dreamhost, or know how to?

    Read the article

  • Testing a Django view cause "AttributeError: 'NoneType' object has no attribute 'handler500'" error

    - by jack
    I just wanted to start testing a Django view using the code below: from django.test.client import Client c = Client() response = c.get('/search/keyword') print response.content It just throws out following error message: "/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 286, in get response = self.request(**r) File "/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 230, in request response = self.handler(environ) File "/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 74, in __call__ response = self.get_response(request) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 143, in get_response return self.handle_uncaught_exception(request, resolver, exc_info) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 178, in handle_uncaught_exception callback, param_dict = resolver.resolve500() File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py", line 268, in resolve500 return self._resolve_special('500') File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py", line 258, in _resolve_special callback = getattr(self.urlconf_module, 'handler%s' % view_type) AttributeError: 'NoneType' object has no attribute 'handler500' The view works in browser. What's wrong with above code?

    Read the article

  • Testing installation package in OpenSolaris

    - by Alex Farber
    Testing my "configure - make - make install" installation package on OpenSolaris, I found that all required files are placed to expected locations. usr/local/bin contains myprogram file. If I type in command line: /usr/local/bin/myprogram, it is working. However, typing "myprogram" without path does not work. Is /usr/local/bin directory included in OpenSolaris executable path? If not, why autoconfig tools place my executable to this directory? Installation package is created in Ubuntu.

    Read the article

  • Actionscript 3 : XML cached in local testing

    - by Boun
    Hi, My question is about XML loading. I need to avoid xml caching. On a web server, the technique is adding a random param to reload each time the XML file. But on local testing (in Flash CS4 IDE, CTRL + Enter), the following lines are not possible : var my_date : Date; path = "toto.xml?time="+my_date.getSeconds()+my_date.getMilliseconds(); Is there any trick to bypass this issue ? I've read on different forum about the "delete" method, we delete the xml object and then recreate one new. In my case, I put : myXML = null; myXML = new XML ( loadedData ); But it doesn't work at all. I spent many hours on that problem, if anyone has a good solution... Thank you.

    Read the article

  • Cross Browser Testing on Virtual Machines - Issues?

    - by codemate2112
    I am part of an organization in which there is contention amongst some very competent folks as to whether or not testing cross-browser behavior for JavaScript applications on virtual machines (for IE6/7/8, FF2/3, Chrome on XP/Vista/7) is reliable. This is using VMWare server on a Linux box host. While the discrepancies seen are few, there are cases in which it has proven difficult to tell if it is a product of virtualization or just different machine configurations. My question to the community is, what is people experience with this? Is there any credence to the claim that VM pose inconsistencies, or are they generally spot-on reliable? Can we trust them?

    Read the article

  • XCode - Copy sqlite DB from simulator and copy onto device for testing

    - by Neal L
    Hello, I am working on a Core Data app, and have populated the sqlite file in the iPhone Simulator with all of the fixtures/data that I use to test the app. I would like to use that sqlite file as a standardized set of testing data. The devices that I test the app on all have different data sets, and I would like to standardize on the one in the simulator. Is there a way in XCode (3 or 4) to add a step to the build/install process that will copy the sqlite file from the iPhone Simulator and install it over the file on the phone (if one exists)? Thanks, Neal

    Read the article

  • Mongomapper - unit testing with shoulda on rails 2.3.5

    - by egarcia
    I'm trying to implement shoulda unit tests on a rails 2.3.5 app using mongomapper. So far I've: Configured a rails app that uses mongomapper (the app works) Added shoulda to my gems, and installed it with rake gems:install Added config.frameworks -= [ :active_record, :active_resource ] to config/environment.rb so ActiveRecord isn't used. My models look like this: class Account include MongoMapper::Document key :name, String, :required => true key :description, String key :company_id, ObjectId key :_type, String belongs_to :company many :operations end My test for that model is this one: class AccountTest < Test::Unit::TestCase should_belong_to :company should_have_many :operations should_validate_presence_of :name end It fails on the first should_belong_to: ./test/unit/account_test.rb:3: undefined method `should_belong_to' for AccountTest:Class (NoMethodError) Any ideas why this doesn't work? Should I try something different from shoulda? I must point out that this is the first time I try to use shoulda, and I'm pretty new to testing itself.

    Read the article

  • automatic enter login credentials while testing my app (from visual studio 2008)

    - by Michel
    Hi all, this is something that i don't want to program, but i was looking for a handy way of logging on to my web app. i'm building (and testing and running) my webapp over and over again, and here i've been provided a strong password. needless to say it's not so nice to enter my full user name + strong password 30 times a day. is there a nifty tool which lives in the background and when i open page localhost/mytestpage.aspx, it will say: "hey, let me type in michel and sdfs%^%gfhg in these two textboxes"?

    Read the article

  • Registry corrupted for testing?

    - by Emile
    Hi. Forgive my ignorance. I'm a lowly LAMP stack developer and this is my first post for "c++". We had an Internet Explorer add-on commissioned but then lost support. Allegedly each version has to be have been tested "on a fresh computer since old add-ons could have cause registry errors." I'm not familiar with IE add-on development (or c++ dev). Is this common? Can't one simply reverse registry errors? How to continue testing iterations on one machine? Thanks!

    Read the article

  • Watin testing of FckEditor

    - by Iyyengar
    I have been working on the integration testing of a webapp using watin. The webapp uses fckeditor as one of the richtext controls. Here is the piece of html of the viewsource of my webapp that includes fckeditor iframe id="ctl00_HeaderMain_txtSafetyNetDescription___Frame" src="/FCKEditor/editor/fckeditor.html?InstanceName=ctl00_HeaderMain_txtSafetyNetDescription&Toolbar=myApp" width="100%" height="200px" frameborder="no" scrolling="no" /iframe By using the watin script ... i am able to get the frame object with the following code. Frame frame = ie.Frame(Find.ById("ctl00_HeaderMain_txtSafetyNetDescription___Frame")) ; Now I want to write some text to the fckeditor. But i am not sure how to write to the fckeditor as it is a frame -- can someone help me on this. Thanks. Iyyengar.

    Read the article

  • Testing file existence using NSURL

    - by Peter Hosey
    Snow Leopard introduced many new methods to use NSURL objects to refer to files, not pathnames or Core Services' FSRefs. However, there's one task I can't find a URL-based method for: Testing whether a file exists. I'm looking for a URL-based version of -[NSFileManager fileExistsAtPath:]. Like that method, it should return YES if the URL describes anything, whether it's a regular file, a directory, or anything else. I could attempt to look up various resource values, but none of them are explicitly guaranteed to not exist if the file doesn't, and some of them (e.g., NSURLEffectiveIconKey) could be costly if it does. I could just use NSFileManager's fileExistsAtPath:, but if there's a more modern method, I'd prefer to use that. Is there a simple method or function in Cocoa, CF, or Core Services that's guaranteed/documented to tell me whether a given file (or file-reference) URL refers to a file-system object that exists?

    Read the article

  • Thread testing for time

    - by DanielFH
    Hi there :) I'm making a thread for my application that's going to do an exit operation at a given time (only hours and minutes, day/month doesn't matter). Is this the right way to do it, and also the right way to test for time? I'm testing for a 24 hour clock by the way, not AM / PM. I'm then in another class going to call this something like new Thread(new ExitThread()).start(); public class ExitThread implements Runnable { @Override public void run() { Date date = new Date(System.currentTimeMillis()); String time = new SimpleDateFormat("HHmmss").format(date); int currentTime = Integer.parseInt(time); int exitTime = 233000; while(true) { try { Thread.sleep(10000); } catch (InterruptedException e) { e.printStackTrace(); } if(currentTime >= exitTime ) { // do exit operation here } } } Thanks. //D

    Read the article

  • Good tool to test WCF service (not SOAP/HTTP webservice)

    - by Kangkan
    I recently found SOAPUI and discovered that it is just a great tool for testing any SOAP/HTTP service. Conventionally, we have been developing our own driver to test our services (WCF based netTCP binding) so far. But with SOAPUI experience, I am really looking for some such tool that can be used with such ease with built-in facilities for load testing, functional testing etc. The other thought in my mind is that for services that I wish to deploy with netTCP can be first tested using a HTTP binding using SOAPUI. Once found suitable, the binding can be changed for the intended one. I shall like the views from all the experts here. Thanks.

    Read the article

< Previous Page | 56 57 58 59 60 61 62 63 64 65 66 67  | Next Page >