TDD: Using Test-Data Containers(eCATT) in Unit-test

Recently I learned about TDD, and learn how to write unit-test for some class. But When I write a report(with DB, post account doc) , I come across some problem.
1. I  have some method just select some data form table , but I don't know how to write this unit-test? I know I can create a TDC though eCATT, but my method is select form table ,how do I finish this ?
2. Also I have some method just handle data, such as check the data or move to another internal table, do I need to write unit-test for this kind method?
Further more , I search the SCN many times , I didn't find a suitable program as TDD program (include SQL, input , output, data handle ). Is there anyone can share your example in TDD for us , thank you so much.
Best Regards!

Glad that you have interest in TDD. I write on ABAP unit at my site zevolving.com 
TDD should not dependent on the data selection from the DB as the DB data could be changed and your test would fail without you being changing the logic.
To avoid the dependency on the data, you need to prepare the dummy test data. You need to than also prepare the expected output from the dummy test data. Once you have the dummy test data, you can pass the data to the method (or subroutine or FM) and get the actual output. You compare the expected output with the actual output to verify it works as expected.
For your example, you should modularize the program - method for GET_DATA, method for PREPARE_OUTPUT, method for GENERATE_OUTPUT. From these methods, you should be able to write unit test on PREPARE_OUTPUT.
In your unit test, you need to declare local variables in your test class if you use the subroutine. if you use the class and methods, you can instantiate the object and you get all the variable access. Thats the reason it would be more easier and less confusing when using the objects with unit test.
Fill up these tables. Say LT_VBRK, LT_VBFA, LT_VBAK. Make sure your subroutine PREPARE_OUTPUT has importing parameters. Pass these to them. Also, prepare the LT_OUTPUT_EXP with the expected results. Declare the table which would hold the actual values LT_OUTPUT_ACT and receive the results from the subroutine PREPARE_OUTPUT. Use the method  cl_aunit_assert=>assert_equals to check the values in the LT_OUTPUT_EXP and LT_OUTPUT_ACT.
Regards,
Naimesh Patel

Similar Messages

  • Not able to change the data of test data containers in production system

    Dear All,
    We have created eCATT scripts in Development SolMan System and moved the transports to Production SolMan System.  Customer wants to change the data at Test data containers and run the scripts in production system but we are not able to edit the data. 
    May be the reason is SCC4 transaction code has set the below option.
    Changes and transports for client-specific Objects
    u2022 No changes allowed
    Customer doesnu2019t want to change the above option and wanted to change the test data containers to give different datau2019s and run the eCATT scripts.
    Could you please let me know the solution for this?
    Your help is really appreciated.
    Thanks,
    Mahendra

    eCatt has the feature where you don't need to transport the scripts or test configuration to our target system. We can keep all our scripts and test data in Solman and run this script any other system in your landscape using the System data container and target system.
    Maintain the production as one of the target system in System container in Solman and point that system while running the script. Change the test data in Solman to run this script.
    Let me know if you need more information
    thanks
    Venkat

  • Using SQLCMD variables in SQL Server Unit Test Project

    Is it possible to use SQLCMD variables in my SQL Server Unit Test Project? In my test initialize script I'd like to set a database name variable, something like this:
    :SETVAR MyDatabase "mydatabase"
    SELECT * FROM [$(MyDatabase)].[mytable]
    but I get syntax errors when I run the test. Any suggestions how I can get this to work.
    Result Message: Initialization method
    myTest.TestInitialize threw exception. System.Data.SqlClient.SqlException: System.Data.SqlClient.SqlException:
    Incorrect syntax near ':'..

    Hi Kevin,
    What is the error?
    This should work only thing i could see is no scheme specified.
    SQL Server uses dbo as default schema.
    In your case:
    :SETVAR MyDatabase "mydatabase"
    SELECT * FROM [$(MyDatabase)].dbo.[mytable]
    Also check your instance collation if its Case sensitive then specify database and table name as exact case.
    Example:
    :SETVAR MyDatabase "[mydatabase]"
    :setvar schemavar "[dbo]"
    :setvar tablevar "[mytable]"
    SELECT * FROM $(MyDatabase).$(schemavar).$(tablevar)

  • Getting Error in Asmx Web Service Unit Testing & not able to debug unit-test Project.

    I am getting below error message while running unit test for ASMX web service
    Failed MyFunction The ASP.NET Web application at 'D:\MyProjectFolder' is already configured for testing by another test run. Only one test run at a time can run
    tests in ASP.NET. If there are no other test runs using this Web application, ensure that the Web.config file does not contain an httpModule named HostAdapter.
    I checked in web.config. Below line already added in web.config. i removed below line to run test again but getting same error message.
    <httpModules>
    <add name="HostAdapter" type="Microsoft.VisualStudio.TestTools.HostAdapter.Web.HttpModule, Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </httpModules>
    i am not able to debug unit test project.
    Please "Mark as Answer" if this post answered your question. :)
    Kalpesh Chhatrala | Software Developer | Rajkot | India
    Kalpesh 's Blog
    VFP Form to C#, Vb.Net Conversion Utility

    Hi Kalpesh,
    >>Failed MyFunction The ASP.NET Web application at 'D:\MyProjectFolder' is already configured for testing by another test run. Only one test run at a
    time can run tests in ASP.NET. If there are no other test runs using this Web application, ensure that the Web.config file does not contain an httpModule named HostAdapter.
    In your web application root, can you find a file named 'web.config.backup'?
    Reference:
    https://social.msdn.microsoft.com/Forums/en-US/e2ad0c20-df90-48dc-818c-8c5ec24d9365/visual-studio-test-is-not-hitting-breakpoints-in-debug?forum=vststest
    Fang also shared more information about debugging the unit test for web project here:
    https://social.msdn.microsoft.com/Forums/en-US/daa16086-b1b8-4917-ad8d-65e23b49e1bc/not-able-to-read-webconfig-through-unit-test-feature-by-visual-studiovsts?forum=vststest
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Importing test data into "Web Service Navigator Test Scenario" fails

    Hello,
    I'm using NW 7.2 Java and have the following problem: when I try to import a XML file containing test data as scenario in the web service navigator and when I execute the scenario or just click on the details of on entry, all input parameters are gone except the first one!
    The XML file was created by the web service navigator itself. I added a few sample web service calls using the web service test function and exported the resulting scenario afterwards. The XML file looks like this (some parameters blackened):
    <?xml version="1.0" encoding="UTF-8"?>
    <rn1:services WSILURL='' xmlns:rn0='java:sap/standard' xmlns:rn1='http://www.sap.com/webas/2007/02/ws/wsnavigator/' xmlns:rn3='http://schemas.xmlsoap.org/soap/encoding/' xmlns:rn2='http://www.w3.org/2001/XMLSchema'>
      <rn1:service name='OrderService' namespace='http://test.sap.com/Scenario/OrderService/' WSDLURL='host:port/sapws/scenario-processes-models_OrderService/OrderService_SAP_DEFAULT_PROFILE_Service/HTTPAuthOverHTTP_1?wsdl&amp;mode=ws_policy'>
        <rn1:operation name='receiveOrder'>
          <rn1:input>
            <Customer>Customer1</Customer>
            <Product>Product1</Product>
            <Quantity>100</Quantity>
            <DeliveryDate>2010-08-19T14:06:24.691+02:00</DeliveryDate>
            <BlockedOrder>false</BlockedOrder>
          </rn1:input>
          <rn1:output></rn1:output>
        </rn1:operation>
        <rn1:operation name='receiveOrder'>
          <rn1:input>
            <Customer>Customer2</Customer>
            <Product>Product2</Product>
            <Quantity>200</Quantity>
            <DeliveryDate>2010-08-19T14:06:24.691+02:00</DeliveryDate>
            <BlockedOrder>false</BlockedOrder>
          </rn1:input>
          <rn1:output></rn1:output>
        </rn1:operation>
      </rn1:service>
    </rn1:services>
    Thanks in advance for any comments on that issue!!!

    Hi
    Hi,
    You can use XML editors like XMLSPY to send the SOAP request or SOAP client tool provided by SAP for this purpose.
    SOAP client- https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/downloads/tools/sap%20nw%20application%20server/sap%20soap%20client%20tool%20download.abst
    Various methods to Testing SOAP
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7ccd3e4e-0501-0010-95ae-afa58cb46b75
    http://www.soapui.org/gettingstarted/your_first_soapUI_project.html
    Hope it helps,
    Regards,
    Abhishek

  • BeginTimer and EndTimer Not Working In Data-Driven Unit Test Using DataSource Attribute

    Using VS2012 Ultimate I have a unit test with the <DataSource> attribute which passes in values from a CSV file.  I'm wrapping the unit test in a load test.  I expect a Transaction to appear in the load test results for each row in my DataSource
    due to the BeginTimer and EndTimer methods in the unit test.  However, I only get 1 transaction, with response time roughly equal to the overall test time.  For example, if each row in the DataSource takes 1 second to process, then my test time and
    transaction time would be about 10 seconds with 10 rows in the CSV file.
    I've created a load test with Constant Load Pattern, 1 user, and 1 test iteration.  Seeing the behavior described above.
    I have tried with and without and the check for $LoadTestUserContext.  I'm only using that because I get a NotSupportedException when running the unit test on its own.  I can't believe this bug still
    exists, but that is another topic.
    Note also that I cannot see the Debug output in the Output window in VS2012.
    Any tips?  Thank you.
        <TestMethod()>
        <DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "|DataDirectory|\TestData\MyValues.csv", "MyValues#csv", DataAccessMethod.Sequential)>
        Public Sub WebServiceTest()
            Dim service As MySvc = New MySvcClient()
            Dim input As MyInput = New MySvcInput()
            input.A = testContextInstance.DataRow("A")
            input.B = testContextInstance.DataRow("B")
            Dim g As Guid = Guid.NewGuid()
            If TestContext.Properties.Contains("$LoadTestUserContext") Then 'running as load test
                TestContext.BeginTimer("MySvcTrans")
                Debug.WriteLine("Begin Transaction MySvcTrans:  {0}", g)
            End If
            Dim output As MySvcOutput = service.Method(input)
            If TestContext.Properties.Contains("$LoadTestUserContext") Then 'running as load test
                Debug.WriteLine("End Transaction MySvcTrans:  {0}", g)
                TestContext.EndTimer("MySvcTrans")
            End If
            Assert.AreEqual(0, output.ReturnCode)
        End Sub

    Hi John,
    >> I expect a Transaction to appear in the load test results for each row in my DataSource due to the BeginTimer and EndTimer methods in the unit test.  However, I only get 1 transaction, with response time roughly equal to the overall test
    time.
    Could you share me a screen shot about the reslut in load test?
    Could you share us the load test result in "Transaction"Tables?
    About how to use the
    Transaction for unit tests, maybe you could get useful informaiton here:
    http://blogs.msdn.com/b/slumley/archive/2006/04/14/load-testing-web-services-with-unit-tests.aspx
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Unit Test Generator - VS 2008 (Cannot add oracle data source)

    Hi All,
    Okay this might just be me (new to ODT for VS) - but If I start VS, go Test -> Add Test.
    Create a Database Unit Test.
    [Give it some name]
    write a query such as select * from <>
    add a test checksum condition , and try to configure the checksum condition.. (Hit configure on the properties - under misc).
    I go to new connection ...
    I only have SQL Server (sqlClient) available. Is the unit test generator/validator something that oracle does not currently yet support?
    (Yes the ODT 11i for VS 2008 is installed, can add a data connection to Oracle systems/query oracle in VS - just cannot add a Oracle database connection for unit database tests).
    Or has anybody found a way to make this very useful piece of functionality work ?
    Best Regards,
    D

    The same thing happens, If I go File -> Open -> Oracle Database Project Items -> SQL Script.
    This comes up as disconnected.
    When right click on the new script choose connect, only SQL Server provider is available with no ability to choose a oracle provider (greyed out to choose a diff connection provider).
    Prehaps someone has seen this before?

  • Unit Test code using wrong persistence unit

    In the midst of learning Maven, I created a simple application in which I am using JPA (Java Persistence 1.0.2) with EclipseLink implementation (2.0.2).
    Note: This is an Application Managed environment. So I manually control EntityManager's life cycle.
    The persistence.xml file used by the main source code is different from the one that unit test code uses. Main code uses an Oracle DB and the test code uses an in-memory Derby.
    Running unit tests was updating the Oracle DB (!) and I eventually managed to fix that by using two different persistence-units in the XML files.
    However, I don't understand why that fixed the problem. I manually create and shut down the entity managers and they are not running concurrently. I'm pretty sure Maven (or the way I set it up) doesn't mess up the resources (XML files). In fact by looking at Maven's debug output I can see it's using the right XML file for unit tests.
    Could someone enlighten me, please?

    Do you have both persistence.xml files on your classpath? If so, and they contain the same name for their respective persistence units, you should be getting a warning or error since they must have unique names. There is no way to tell which one you want to access otherwise.
    Best Regards,
    Chris

  • Performance test from unit tests

    Hi;
    I tried to apply the principle TDD at the level of perf test of an J2ee application and this from units tests.
    I thus used the tool JUnitPerf but regrettably with this tool I must to modify my unit test for the update of the sequence of a test and it propose nobody management of waiting time between every call of a unit test.
    Q : Know a tool more complete, stable and maintained which allows to write of the perf tests from unit test ?
    Regards;

    Hi John,
    The testing will depend on the scenario's configured in SAP, which are to be tested. As scenario vary from customer to customer, it is not possible to send a document with screen shot, as these are confidential documents. However, the write-up below should be able to give some clueon the same.
    <b>Different Type of Testing are as under</b>:
    Unit testing is done in bit and pieces. Like e.g. in SD standard order cycle; we do have 1-create order, then 2-delivery, then 3-transfer order, then 4-PGI and then 5-Invoice. So we will be testing 1,2,3,4 and 5 seperately alone one by one using test cases and test data. We will not be looking and checking/testing any integration between order and delivery; delivery and TO; TO and PGI and then invoice.
    Whrereas System testing you will be testing the full cycle with it's integration, and you will be testing using test cases which give a full cyclic test from order to invoice.
    Security testing you will be testing different roles and functionalities and will check and signoff.
    Performance testing is refered to as how much time / second will take to perform some actions, like e.g. PGI. If BPP defination says 5 seconds for PGI then it should be 5 and not 6 second. Usually it is done using software.
    Regression testing is reffered to a test which verfies that some new configuration doesnot adversly impact existing functionality. This will be done on each phase of testing.
    User Acceptance Testing: Refers to Customer testing. The UAT will be performed through the execution of predefined business scenarios, which combine various business processes. The user test model is comprised of a sub-set of system integration test cases.
    Regards,
    Rajesh Banka
    Reward suitable points.
    How to give points: Mark your thread as a question while creating it. In the answers you get, you can assign the points by clicking on the stars to the left. You also get a point yourself for rewarding (one per thread).

  • Difference between unit testing and integration testing

    What is the difference between unit testing and integration testing in SAP? Is unit testing takes place in Dev client and integration testing takes place in QA system?
    Please clarify
    thanks

    Hello Krishen,
    unit testing means veryfiingsmall / the smallet pieces of software, while integration testing checks the overall functionality of applications. Within the AS ABAP the tool ECATT + manual tests is used for integration tests and the ABAP Unit language integration for unit testing.
    When, Who, Where tests are carried out is ultimately a personal decision. As unit tests are operate even under heavy development they are often the first choice for developers, but the unit tests can also serve for regression tests over a long period. Integration tests tend too be created and executed in later stages as they require often a certain majurity of the software under test.
    Beside the mentioned links you may check out ABAP Unit infos also in the Wiki.
    https://wiki.sdn.sap.com/wiki/display/HOME/ABAP+Unit
    Best Regards
      Klaus

  • SSDT: Creation of localDB instances from project file - Sql Server Unit testing purposes

    I have a SqlServer Database Project in my solution (VS2013 Professional) which has a corresponding test project with some stored procedure unit tests. Currently I am using a LocalDB and as far as I understand a local database instance is created in C:\Users\[User]\AppData\Local\Microsoft\Microsoft
    SQL Server Local DB\Instances\Projects and the specific .mdf file referenced in the SQL Server Object Explorer is in C:\Users\[User]\AppData\Local\Microsoft\VisualStudio\SSDT\[ProjectName]. The unit tests run fine on my local machine which I have developed
    the project on.
    My issue is we have a box which is configured to check out the project file from our version control, build the project using ms build commands and then run the unit tests using VSTest.Console. Usually with C# Test projects we reference the test project
    dll and the unit tests run fine. I have referenced the dll for the test project with the stored procedure unit tests in. 
    With the Stored Procedure unit tests however we get this exception: 
    Initialization method [project].[spTest].TestInitialize threw exception. System.Data.SqlClient.SqlException: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. The specified LocalDB instance does not exist.
    After some digging I have realised that the localdb instance seems to be created when the project itself is created in VS not when it is built. Specifically when the localdb is first used and if you look into the appData folder of the test machine there
    is no corresponding mdf file for the project.  
    The question is is there a way to set up a localDB instance on the new machine if all you have the project file? The only purpose of the project on the test machine is to run the unit tests, no other development purposes. VS2013 Professional is installed
    on the test machine but a solution only using config file changes or MSBuild/VSTest commands would be preferable.
    I realise you could change the connection string to an actual test database and run the unit tests of that but we quite like the localdb approach for the testing. I also realise that you could potentially transfer the mdf file (haven't tested this solution)
    as well, though I would prefer if there is a solution to my initial question. 
    http://technet.microsoft.com/en-us/library/hh234692.aspx
    http://msdn.microsoft.com/en-us/library/hh309441(v=vs.110).aspx
    I have been reading up on LocalDB and I assume a automatic LocalDB is created when you create a sql server database project (ie on localdb first use). I have tried adding the database creation to the test project config file but do not really know where
    to go from there. The second link does not really specify when the named localdb will be created if you add the config items and I am not even sure if that is an actual solution.  Here's my test project config file for reference
    <configSections>
    <section name="system.data.localdb" type="System.Data.LocalDBConfigurationSection,System.Data,Version=4.0.0.0,Culture=neutral,PublicKeyToken=[PublicKeyToken]"/>
    <section name="SqlUnitTesting_VS2013" type="Microsoft.Data.Tools.Schema.Sql.UnitTesting.Configuration.SqlUnitTestingSection, Microsoft.Data.Tools.Schema.Sql.UnitTesting, Version=12.0.0.0, Culture=neutral, PublicKeyToken=[PublicKeyToken]" />
    </configSections>
    <system.data.localdb>
    <localdbinstances>
    <add name="SimpleUnitTestingDB" version="11.0" />
    </localdbinstances>
    </system.data.localdb>
    <SqlUnitTesting_VS2013>
    <DatabaseDeployment DatabaseProjectFileName="..\..\..\SimpleUnitTestDB\SimpleUnitTestDB.sqlproj"
    Configuration="Release" />
    <DataGeneration ClearDatabase="true" />
    <ExecutionContext Provider="System.Data.SqlClient" ConnectionString="Data Source=(localdb)\Projects;Initial Catalog=SimpleUnitTestDB;Integrated Security=True;Pooling=False;Connect Timeout=30"
    CommandTimeout="30" />
    <PrivilegedContext Provider="System.Data.SqlClient" ConnectionString="Data Source=(localdb)\Projects;Initial Catalog=SimpleUnitTestDB;Integrated Security=True;Pooling=False;Connect Timeout=30"
    CommandTimeout="30" />
    </SqlUnitTesting_VS2013>
    Thanks in advance for any response. Sorry if there is any misunderstanding, while I have been using VS to develop from the start, this is the first time I have used a Sql Server Database Project. 
    Regards,
    Christopher. 

    Yes, you can create a LocalDB instance manually. You use the SqlLocalDb utility, see here:
    http://technet.microsoft.com/en-us/library/hh212961.aspx
    Erland Sommarskog, SQL Server MVP, [email protected]

  • ABAP unit: test classes part of prod. code

    Hi all,
    I've read <a href="https://weblogs.sdn.sap.com/pub/u/266">Thomas Weiss</a>'s weblog: <a href="/people/thomas.weiss/blog/2004/12/17/a-spotlight-on-abap-unit-part-1 Spotlight on ABAP Unit Part 1</a>.
    I posted a question there, but apparently Thomas can't answer at the moment, and since I'm impatient for getting someone's opinion, I reckon we can discuss that topic here  :^)
    As explained in the <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c1be1003-0701-0010-3795-f87160de6483">NetWeaver Developer’s Guide Using ABAP</a>, the test classes are part of the program under test (PUT):
    <i>In ABAP Unit, test classes are part of the production code of the TU. This avoids problems arising from the test code being separate from the production code:
    - Programs and tests must be kept synchronized.
    - You have to ensure that the test and program code are transported together.
    - External test code only enables black box tests with an outside perspective of the tested program.
    Since the test code is part of the production code, it is easy to keep the unit tests and the
    production code up to date if the latter is changed.
    Although the test code and the production code are transported through the system landscape, ABAP unit tests do not increase the load on the production system. By default, the test code is not compiled in the production system. Therefore, the test code can never be executed in the production system.</i>
    On the other hand, this idea is quite different from what suggested by other unit testing frameworks.
    For instance, the documentation of <a href="http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html">Test::Unit - Ruby Unit Testing Framework</a> reads:
    <i>It‘s handy to collect a bunch of related tests, each test represented by a method, into a common test class that knows how to run them.
    The tests will be in a separate class from the code they‘re testing for a couple of reasons. First of all, it allows your code to stay uncluttered with test code, making it easier to maintain. Second, it allows the tests to be stripped out for deployment, since they‘re really there for you, the developer, and your users don‘t need them. Third, and most importantly, it allows you to set up a common test fixture for your tests to run against.</i>
    Regarding the advantages outlined by NetWeaver Developer’s Guide:
    - Programs and tests might be kept synchronized even if they don't belong to the same unit of code.
    - Moreover, you could assure that the test and program code are transported together by saving them in the same package.
    - And quite frankly, I don't have a thourough understanding of the reason why external tests only allow <i>black box tests with an outside perspective</i>.
    What are your opinions on this?
    Regards, Davide

    Hi,
    when I started unit testing with JUnit I was quite surprised that SAP groups the tests with the production code. But now I actually really like it. It has a few advantages:
    - Good tests serve as an excellent documentation so why not bundling them together.
    - If you want to look at the tests they are easy to find.
    - I write all my class tests as local classes. I found out that it really helps me to focus on writing tests only for the class under test. Sometimes it is quite easy to forget the "unit" and write integration tests again.
    Regarding your question:
    >And quite frankly, I don't have a thourough understanding of the reason why external tests only allow black box tests with an outside perspective.
    Usually I would not use the term black box testing in this context. Maybe you mean that it is easy to access private attributes, methods when you group class and testclass together?
    Normally black box testing means that you cannot look at the implementation of the code under test. So your tests are based on the specifications or if there is not one, on your common sense.
    cheers
    Thomas

  • Abt unit  test plan

    hi
    can u plz explain abt unit test planning?
    es

    hi bramara,
    Unit testing is used to test the proper working of a single module.
    Integration testing is used to test the integration between the modules,
    when the complete business scenario of a client is tested (say from sales order creation to receipt of money from customer).
    Unit Testing
    When you test every single document is called unit testing.
    String Testing
    One transaction full activity is called string testing. For example Vendor
    invoice, goods received and vendor payment.
    Integration Testing
    It is purely with other modules and we have to check whether the FI testing
    is working with other related modules or not.
    Testing of combined parts of an application to determine if they function
    together correctly.There are three types of integration testing.1. Big bang
    testing: Testing with all modules combined together invariable of its
    levels. Often done for small projects.2. Bottom up test:Testing by
    integrating lower level modules and ascending towards the higher-level
    modules.3. Top down: Testing the higher-level modules and descending towards
    the lower level modules.This can be accomplished with dummy modules to
    replace the under construction modules with so-called stubs and drivers.
    not.
    Regression Testing
    Testing for whole database. Bring all the data into another server and do
    the testing is called regression.
    Thanks,
    <REMOVED BY MODERATOR>
    kushagra
    Edited by: Alvaro Tejada Galindo on Jan 31, 2008 9:45 AM

  • Unit testing in nitrox

    I am new to eclipse and nitrox. Have been building webapps for years with IDEA.
    1) I find info in eclipse help concerning Junit based testing, I find nothing about unit testing in NitroX help. The webapps I am trying to import and build in NitroX must support unit testing. Eclipse Junit based help does not work for me in NitroX webapp.
    2) I have created several types of new webapps in NitroX accepting default parameters in wizard hoping to see how NitroX would lay out a new development environment. None of the results comes close to the development structure described in eclipse help. I find a src folder inside WEB-INF folder. This does not make sense to me and I can find no explanation of what NitroX expects with regards to project structure other than the existence of WEB-INF just below webapp context folder. My ultmate goal is to use both NitorX and IDEA accessing the same CVS repositories. So far I have imported several existing webapps via 'folder import' of source tree, but NitroX does note 'see' my testsrc or testbuild branches and I can not run tests except via my own custom Ant scripts. Any suggetions?
    Thanks

    1) I find info in eclipse help concerning Junit based testing, I find nothing about unit testing in NitroX help. The webapps I am trying to import and build in NitroX must support unit testing. Eclipse Junit based help does not work for me in NitroX webapp.
    If you have a Java class that extends JUnit, then in Eclipse, when you're in the Java-perspective, you can right-click on that class, "Run As..." and select "JUnit Test." That'll give you the JUnit Green or Red bar based on whether the tests succeeded/failed, etc.
    NitroX = Eclipse + Struts functionality. Anything you could do in Eclipse, you can do using NitroX.
    You could, for example, switch to the Java-perspective and perform JUnit testing exactly as in Eclipse without NitroX. Or, if you're in NitroX's "Web" perspective, you can go into Package Explorer and run JUnit tests from there.
    Re: 2)
    NitroX puts a "src" folder in your WEB-INF and sets that to be a source code folder, probably so when the application is deployed on the server, the source code is also on that server (in the isolated-from-the-web WEB-INF directory), which can be beneficial for several reasons, including your development environment and CVS server crashing.
    You could delete that folder, though, and use a folder you created yourself as a source code folder for that project. You'd just have to make sure that when you designate that source code folder (via: right-click on the project -> Properties -> Java Build Path -> Source Folders), you designate the output target of that folder to be /WEB-INF/classes. That'll make sure that, regardless of where your .java files are, your .class files will be placed in the appropriate folder inside your web application structure.
    Regarding NitroX not "see"ing your testsrc or testbuild branches (I assume you mean "folders" instead of "branches" ...), I'm assuming you're using NitroX's "Web" perspective, and looking for those folders in the AppXplorer window. Since your JUnit tests are not a part of the Struts application, you won't find them there -- instead, click over to the Package Explorer view, or switch over to Eclipse's Java Perspective, where everything will behave exactly as you'd expect.
    I hope this helps ..

  • Unit testing? help.

    OK, I have tried to rap my mind around this for a few days. Unit testing.
    I understand the whole:
    if(expected)
    System.out.println("OK");
    else System.out.println("Error");Part of my class assignment but, I am still confused. Could someone explain how unit testing works? (*No, I don't want you to do it for me or anything like that.*) I am just confused on how exactly to test for these things in Java. I understand that I need to add some kind of input then check the return value with what is expected. However, I am not sure how to implement it.
    Currently I tried something:
    public static void lastIndexOfTest(MyString ms, int pos, char expected){
              System.out.println("Testing lastIndexOf("+pos+") on MyString " + ms);
              System.out.println("Expected: " + expected);
              try{
                   int got = ms.charAt(pos);
                   System.out.println("Got: " + got);
                   if(got == expected)
                        System.out.println("OK");
                   else
                        System.out.println("Error2");
              catch(Exception e) {
                   System.out.println("Error: " + e);
              }That works in the sense that it give me no errors. But, because I don't understand how the code works exactly for everything I am not sure at all if it is even returning something thats correct.
    Here is my assignment:
    http://www.csl.mtu.edu/cs1122/www/programs/prog1/desc.html
    Are there any tutorials on how to do unit testing? I have been looking all over and can't seem to find any listed on Google.

    shawnw wrote:
    OK, I have tried to rap my mind around this for a few days. Unit testing."Unit" == "one thing". You're testing each individual part of your program that can be considered a single functional unit (not necessarily a single class).
    Although I've heard people say "unit testing" to apply to just about everything.
    That works in the sense that it give me no errors. But, because I don't understand how the code works exactly for everything I am not sure at all if it is even returning something thats correct.Well, obviously, knowing what's correct is necessary before you can test for correctness.
    Typically, you introduce specific test data to the thing being tested, and you know the correct response for that test data.
    For example if you're testing a factorial program, you know that 3! == 6.
    If you have a bit of (your own code) and you don't know what correct behavior of that code is, then you're not done. Really you shouldn't have started coding if you didn't know what you were trying to accomplish when you were done.
    In test-driven development, you write the test before you write the code. Among other things, this ensures that you know what a bit of code is supposed to accomplish before you even start, which is a good thing.
    Here is my assignment:
    http://www.csl.mtu.edu/cs1122/www/programs/prog1/desc.html
    Are there any tutorials on how to do unit testing? Didn't your professor mention it in class?
    I have been looking all over and can't seem to find any listed on Google.I find that hard to believe. If I Google "unit testing tutorial" I find a bunch. But several of those are specific to particular environments, so maybe that's what's throwing you off.
    The canonical unit testing framework for Java is JUnit. You might want to google for JUnit tutorials (I just did and found some).

Maybe you are looking for