<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Automatically create test data for ABAP Unit Tests in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/automatically-create-test-data-for-abap-unit-tests/m-p/12510450#M2003987</link>
    <description>&lt;P&gt;even if you have private/protected method you could do abap unit, even if it is bad usage.&lt;/P&gt;&lt;P&gt;You have to use LOCAL FRIEND stuff&lt;/P&gt;</description>
    <pubDate>Fri, 25 Mar 2022 12:51:19 GMT</pubDate>
    <dc:creator>FredericGirod</dc:creator>
    <dc:date>2022-03-25T12:51:19Z</dc:date>
    <item>
      <title>Automatically create test data for ABAP Unit Tests</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/automatically-create-test-data-for-abap-unit-tests/m-p/12510447#M2003984</link>
      <description>&lt;P&gt;I want to automatically create test data for ABAP unit tests for one of my classes.&lt;/P&gt;
  &lt;P&gt;In there I have a huge method with lots of imports, exports, etc.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;"! &amp;lt;p class="shorttext synchronized"&amp;gt;Modify payment IDOCs&amp;lt;/p&amp;gt;
    "! @exception dont_create_idoc | &amp;lt;p class="shorttext synchronized"&amp;gt;Don't created a payment IDOC&amp;lt;/p&amp;gt;
    "! @parameter im_mestyp | &amp;lt;p class="shorttext synchronized"&amp;gt;Message type&amp;lt;/p&amp;gt;
    "! @parameter im_reguh | &amp;lt;p class="shorttext synchronized"&amp;gt;Payment data from the payment program&amp;lt;/p&amp;gt;
    "! @parameter im_regud | &amp;lt;p class="shorttext synchronized"&amp;gt;Transfer data form printing&amp;lt;/p&amp;gt;
    "! @parameter im_flag_no_replace | &amp;lt;p class="shorttext synchronized"&amp;gt;SPACE=Special characters conversion required in texts&amp;lt;/p&amp;gt;
    "! @parameter ex_fimsg | &amp;lt;p class="shorttext synchronized"&amp;gt;FI-messages&amp;lt;/p&amp;gt;
    "! @parameter ch_xavis | &amp;lt;p class="shorttext synchronized"&amp;gt;Flag: Advice required&amp;lt;/p&amp;gt;
    "! @parameter ch_edidc | &amp;lt;p class="shorttext synchronized"&amp;gt;Control record (IDoc)&amp;lt;/p&amp;gt;
    "! @parameter t_regup | &amp;lt;p class="shorttext synchronized"&amp;gt;Processed items from the payment program&amp;lt;/p&amp;gt;
    "! @parameter t_edidd | &amp;lt;p class="shorttext synchronized"&amp;gt;Data record (IDoc)&amp;lt;/p&amp;gt;
    METHODS change_idoc
      IMPORTING
        im_mestyp          TYPE edidc-mestyp
        im_reguh           TYPE reguh
        im_regud           TYPE regud
        im_flag_no_replace TYPE c
      EXPORTING
        ex_fimsg           TYPE fimsg
      CHANGING
        ch_xavis           TYPE c
        ch_edidc           TYPE edidc
        t_regup            TYPE t_regup
        t_edidd            TYPE t_edidd
      EXCEPTIONS
        dont_create_idoc.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;I wonder if its possible to generate test data automatically which I can use in ABAP unit tests?&lt;/P&gt;
  &lt;P&gt;My goal would be to have for example a line in my setup method of the test class with:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;reguh =  VALUE #( ... )&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Mar 2022 10:50:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/automatically-create-test-data-for-abap-unit-tests/m-p/12510447#M2003984</guid>
      <dc:creator>schmelto</dc:creator>
      <dc:date>2022-03-25T10:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically create test data for ABAP Unit Tests</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/automatically-create-test-data-for-abap-unit-tests/m-p/12510448#M2003985</link>
      <description>&lt;P&gt;Yes but No, Tom &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(when I learn about Abap Unit I had exactly the same idea &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; )&lt;/P&gt;&lt;P&gt;You forget one of the golden rule regarding ABAP Unit :  The data must not be real data &lt;/P&gt;&lt;P&gt;You have a second problem, your method is little bit complex for ABAP Unit, you have so many cases, it is maybe the reason why you would like to do a mass test on it. &lt;/P&gt;&lt;P&gt;You should do ABAP Unit on the methods used inside this method (and following Single Responsibility)&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 11:29:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/automatically-create-test-data-for-abap-unit-tests/m-p/12510448#M2003985</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-03-25T11:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically create test data for ABAP Unit Tests</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/automatically-create-test-data-for-abap-unit-tests/m-p/12510449#M2003986</link>
      <description>&lt;P&gt;Thanks  &lt;SPAN class="mention-scrubbed"&gt;frdric.girod&lt;/SPAN&gt; I've assumed something like this. Yes the method is really complex.&lt;/P&gt;&lt;P&gt;I will implement Unit Tests for less complex methods which are used inside this method&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 12:26:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/automatically-create-test-data-for-abap-unit-tests/m-p/12510449#M2003986</guid>
      <dc:creator>schmelto</dc:creator>
      <dc:date>2022-03-25T12:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically create test data for ABAP Unit Tests</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/automatically-create-test-data-for-abap-unit-tests/m-p/12510450#M2003987</link>
      <description>&lt;P&gt;even if you have private/protected method you could do abap unit, even if it is bad usage.&lt;/P&gt;&lt;P&gt;You have to use LOCAL FRIEND stuff&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 12:51:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/automatically-create-test-data-for-abap-unit-tests/m-p/12510450#M2003987</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-03-25T12:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically create test data for ABAP Unit Tests</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/automatically-create-test-data-for-abap-unit-tests/m-p/12510451#M2003988</link>
      <description>&lt;P&gt;Generating test data doesn't mean generating real data. You can think of a tool which analyzes the code under test and proposes possible values for test data, combinations and so on. I don't know if such a tool exists in ABAP.&lt;/P&gt;&lt;P&gt;I don't have this issue because I create the tests and the test data before coding (test-driven development)&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 18:39:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/automatically-create-test-data-for-abap-unit-tests/m-p/12510451#M2003988</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-03-25T18:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically create test data for ABAP Unit Tests</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/automatically-create-test-data-for-abap-unit-tests/m-p/12510452#M2003989</link>
      <description>&lt;P&gt;Hi Tom,&lt;BR /&gt;&lt;BR /&gt;have you checked out this approach?:&lt;BR /&gt;&lt;A href="https://blogs.sap.com/2017/12/17/abap-debugger-enhancement-or-how-to-speed-up-your-test-data-creation-process/" target="test_blank"&gt;https://blogs.sap.com/2017/12/17/abap-debugger-enhancement-or-how-to-speed-up-your-test-data-creation-process/&lt;/A&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2023 10:21:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/automatically-create-test-data-for-abap-unit-tests/m-p/12510452#M2003989</guid>
      <dc:creator>alex_geppart</dc:creator>
      <dc:date>2023-03-26T10:21:07Z</dc:date>
    </item>
  </channel>
</rss>

