Upgrade to Pro — share decks privately, control downloads, hide ads and more …

COBOLでもやりたいテスト自動化 .pdf

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

COBOLでもやりたいテスト自動化 .pdf

Avatar for daisukhayash

daisukhayash

March 27, 2012
Tweet

Other Decks in Programming

Transcript

  1. Ex: JUnit public class GetAgeTest extends TestCase { public void

    testGetAge() { Nenrei nenrei = new Nenrei(); int age = nenrei.getAge("1979/10/8"); assertEquals("೥ྸ͕ਖ਼͘͠ͳ͍",32, age); } } ੜ೥݄೔Λड͚औͬͯ೥ྸΛฦ͢ϝιουΛྫʹ int Nenrei.getAge(String birthday) 12೥3݄28೔ਫ༵೔
  2. Ex: JUnit //========== JUnit 3.8.2 =================== java -classpath .;junit-3.8.1.jar junit.textui.TestRunner

    junit.JUnitSampleTest ...E. Time: 0.002 There was 1 error: 1) testC(junit.JUnitSampleTest)java.lang.RuntimeException: Exception at junit.JUnitSampleTest.testC(JUnitSampleTest.java: 31) Tests run: 3, Failures: 0, Errors: 1 ग़ྗ͞Εͨ݁Ռͷྫ 12೥3݄28೔ਫ༵೔
  3. Ex: RSpec describe Nenrei do subject do Nenrei.new end context

    "೔෇͕༩͑ΒΕͨ࣌" do it "೥ྸΛฦ͢" do subject.getAge("1979/10/08").should == 32 end end end ಉ͡೥ྸϝιουͷྫ 12೥3݄28೔ਫ༵೔
  4. Ex: RSpec describe Stack do context "when new" do it

    { should be_empty } it { should have(0).items } end end ΋ͬͱ΋γϯϓϧͳྫ 12೥3݄28೔ਫ༵೔
  5. Ex: COBOLUnit PROCEDURE DIVISION USING CBU-ctx CBU-user-context. * Initialize a

    command order MOVE ITALY TO TO-COUNTRY. MOVE FRANCE TO FROM-COUNTRY. MOVE "S99MLP15" TO PRODUCT-CODE. * Call the COBOL program that set deliver taxes CALL "PR-ORDER" USING COMMAND-ORDER COUNTRY-LIST. * Add Assertion for deliver tax MOVE "FR => IT:TAX=120" TO CBU-ASSERT-NAME. SET CBU-ASSERT-EQUAL TO TRUE. SET CBU-ASSERT-INT TO TRUE. MOVE 120 TO CBU-ASSERT-EXPECTED-INT. MOVE DELIVER-TAX TO CBU-ASSERT-ACTUAL-INT. CALL CBU-assert USING CBU-ASSERT-CALL-INTERFACE CBU-ctx. 12೥3݄28೔ਫ༵೔
  6. RSpec on COBOL describe Nenrei do subject.invoke do record=Record.define("ੜ೥݄೔", "೥ྸ")

    Invoker.new("nenrei.dll", record) end context "೔෇͕༩͑ΒΕͨ࣌" do before :all do subject.ੜ೥݄೔ = "1979/10/8" subject.invoke end it "೥ྸΛฦ͢" do subject.೥ྸ.should == 32 end end end 12೥3݄28೔ਫ༵೔