Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Tagged as

Go to top

Process Performance Determination in C#: Part 2

, 14 Jun 2012
The program presented here provides a simple way to obtain process performance through PPM.
ProcessPerformance2.zip
ProcessPerformance2
Local.testsettings
ProcessPerformance2
ProcessPerformance2.vsmdi
bin
Debug
ProcessPerformance2.dll
Release
ProcessPerformance2.csproj.user
Properties
TestResults
Sitt_JANAKA-PC 2012-06-13 11_14_54
Sitt_JANAKA-PC 2012-06-13 11_14_54.trx
In
JANAKA-PC
Out
AgentRestart.dat
Sitt_JANAKA-PC 2012-06-13 11_17_53
Sitt_JANAKA-PC 2012-06-13 11_17_53.trx
In
JANAKA-PC
Out
AgentRestart.dat
Sitt_JANAKA-PC 2012-06-13 11_18_31
Sitt_JANAKA-PC 2012-06-13 11_18_31.trx
In
JANAKA-PC
Out
AgentRestart.dat
Sitt_JANAKA-PC 2012-06-13 11_21_26.trx
Sitt_JANAKA-PC 2012-06-13 12_13_04.trx
TraceAndTestImpact.testsettings
UnitTestPerformance2
bin
Debug
ProcessPerformance2.dll
UnitTestPerformance2.dll
Release
Properties
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ProcessPerformance2;

namespace UnitTestPerformance2
{
    /// <summary>
    /// Summary description for UnitTest1
    /// </summary>
    [TestClass]
    public class UnitTestPerformance2
    {
        public UnitTestPerformance2()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test 
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        [TestMethod]
        public void TestProcessPerformance2()
        {
            ProcessPerformanceFrPPM ppm = new ProcessPerformanceFrPPM();
            ppm.NumOfUnitProcessed = 40000;
            ppm.NumOfDefectivePart = 165;
            ppm.Analyze();
            Assert.AreEqual(0.004125, ppm.Result.DPU, 1E-06, "DPU failed!");
            Assert.AreEqual(4125, ppm.Result.PPM, 1E-02, "PPM failed!");
            Assert.AreEqual(99.5875, ppm.Result.YieldInPercent, 1E-04, "Yield failed!");
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Sitt Chee Keen
Foundasoft.com
Malaysia Malaysia
Consultant

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 14 Jun 2012
Article Copyright 2012 by Sitt Chee Keen
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid