开发者

Implementation testing and unit testing

I just wondered what the differences with unit testing and imp开发者_如何学Pythonlementation testing are. I know unit testing is testing your modules/class/objects using defined inputs and checking the results against some defined outputs but what does implementation testing do and how do you do it? Also where does implementation testing fit in the development lifecycle?


"implementation testing" is not a common expression. I suspect that you meant "integration testing", since that is commonly used, especially in contrast to unit testing.

Integration testing means testing multiple parts or all of the system acting together. Often, the tests simulate an actual user working with the system through its regular UI.

The advantage is that you don't just test whether each component fulfils its contract, but also whether they are composed and configured correctly and interact as expected - things that you can't catch with unit tests. On the other hand, it's often hard to exhaustively test boundary conditions with integration tests, they're less stable and take much longer to execute. And of course they cannot be run (or even written) until most of the system is working.

Thus, integration tests happen much later in the development lifecycle than unit tests.


I've heard implementation testing used in two different contexts. First, it can be a test of the design. If you've got complex logic, you step through the logic before you hand it off to a coder - that way you don't waste time implementing something that you should have designed better. I've also heard it used as another term for V&V (validation and verification), where you make sure your implementation matches your requirements and that it meets the customer's vision.


Implementation is either PRE or POST.

In this case, implementation means "Putting live" I.e. - Into Production.

So pre-implementation testing means testing in pre-prod just before live. Post-implementation testing means testing in live environment, once it has gone live.


I worked with Visual Studio Testing Tools, Testdriven.net and Excel, all of them together very good solution, I wrote this unit test

[TestMethod()]
public void viewFolderTest()  
{
    string Err = "";
    connect_Excel("viewFolderTest");            
    DcDms actual;
    DaDoc target = new DaDoc(); 

    for (int i = 10; i < ds.Tables[0].Rows.Count; i++)
    {
        Err = "";

        TestRow = ds.Tables[0].Rows[i]["Row"].ToString();
        string expected = ds.Tables[0].Rows[i]["expected"].ToString();
        string ParentId = ds.Tables[0].Rows[i]["ParentId"].ToString(); 

        actual = target.viewFolder(ParentId);

        try
        {
            Assert.AreEqual(expected,actual.Tables[DcDms.Dms_vrFileFolder].Rows.Count.ToString());
        }
        catch (System.Exception ex)
        {
            Err = ex.Message;
            if (Err.Length >= 254)
            {
                Err = Err.Substring(0, 255);   
            }
            Update_Excel("viewFolderTest", "ERROR", Err, "Row", TestRow);
        }
        Update_Excel("viewFolderTest", "actual", actual.Tables[DcDms.Dms_vrFileFolder].Rows.Count.ToString(), "Row", TestRow);
        if (Err == "")
        {
            Update_Excel("viewFolderTest", "ERROR", "Pass", "Row", TestRow);
        }
    }          
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜