Skip to content
This repository was archived by the owner on Jul 21, 2021. It is now read-only.

Conversation

@khalifima
Copy link
Contributor

the testing library is a shared component between the test application and the test suites therefore a natural place for it is in core/ for a clean dependency structure.

@HansUweRempler HansUweRempler added Epic: Continuous integration Verification and validation via automated testing: unit, integration and system Prio: High High priority issue (max prio level) Type: Feature User story, tasks/sub-tasks as markdown list inside an issue labels Feb 11, 2020
Copy link
Contributor

@elbosch elbosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let us talk about naming and coding conventions.

*/
enum KISO_TESTING_Retcodes_E
{
TEST_RETCODE_TEST_SUITE_ALREADY_REGISTERED = RETCODE_FIRST_CUSTOM_CODE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so far we had started every retcode with RETCODE_ so in this case it would be like RETCODE_TESTING

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be honest I did not change in the naming except if there is something clear. I will change it

/**
* @brief Encapsulates the elements composing a message..
*/
typedef struct CCMsg_S
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would expect this to be somewhere defined in a CChannel, CCMessage, etc. context

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should match maybe more the names used in python

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as you can see below there are functions defined here depending on this structure, do we really need to hide it or to add indirection here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question actually is: Why do those functions depend on this structure?
Looks to me that the name is not properly chosen. Are we more likely talking about a testing context?

What do those functions really expect?

Why should this Testing API depend on any detail on how things are stored, assembled,

/**
* @brief Defines a prototype type for the setup functions of the test suites and test cases.
*/
typedef Retcode_T (*StpFct_T)(CCMsg_T *ccmsg);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to talk about the naming conventions.. First rule in my opinion it should be pronounceable and clear.
here it could be StopFunction or a StepFunction. well established abbreviations are ok.

Copy link
Contributor

@sebastianpfischer sebastianpfischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to put it within an app / example place or root/testing/*

@elbosch
Copy link
Contributor

elbosch commented Feb 18, 2020

@khalifima are you able to work on this this week or shall we support here?

@@ -0,0 +1,192 @@
/**********************************************************************************************************************
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should discuss about the location of testing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testing is a shared library between the test cases written in e.g core/essentials or boards and the test application. I think this is the place where it has to be located

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unfortunately not convinced. I still believe that high cohesion is important, we need to discuss it the 3 of us.

@HansUweRempler
Copy link
Contributor

@khalifima can you please update here? We need this for the planned release v0.1 on 13.03.20. Please note that if you can't continue right now here, @elbosch is volunteering to take over the task.

/**
* @brief Encapsulates the elements composing a message..
*/
typedef struct CCMsg_S
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question actually is: Why do those functions depend on this structure?
Looks to me that the name is not properly chosen. Are we more likely talking about a testing context?

What do those functions really expect?

Why should this Testing API depend on any detail on how things are stored, assembled,

/**
* @brief Enumerates the types of messages exchanged between the Test_Executor and the Test_Controller
*/
enum CCMsg_MessageType_E
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from naming perspective this does not belong here.

/**
* @brief Encapsulates the elements composing the message header.
*/
typedef struct MessageHeader_S
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name is not properly showing it's scope.

*/
typedef struct MessageHeader_S
{
uint8_t messageInfo; /**< version is 2 bits, message type is 2 bits and the remaining 4 bits are reserved */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this level of embedded squeezing of information?

typedef struct MessageHeader_S
{
uint8_t messageInfo; /**< version is 2 bits, message type is 2 bits and the remaining 4 bits are reserved */
uint8_t messageToken;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please also describe the content of those members

#endif

#ifndef CCHANNEL_MAX_NUMBER_OF_TLV_ELEMENTS
#define CCHANNEL_MAX_NUMBER_OF_TLV_ELEMENTS 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is configurable in this context, it should start with TEST

}
}

static uint16_t calculateCRC(uint8_t *buffer, uint8_t length)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we just use CRC from utils?

SetupFct_T setup;
TearDownFct_T teardown;
TstSte_T testSuites[TEST_MAX_NUMBER_OF_TEST_SUITES];
} TstEnt_T, TstEnt_T;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please stick to our coding guidelines here.

SetupFct_T setup;
RunFct_T run;
TearDownFct_T teardown;
} TstCse_T, TstCse_T;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not simplify readability. and why twice?

SetupFct_T setup;
TearDownFct_T teardown;
TstCse_T testCases[TEST_MAX_NUMBER_OF_TEST_CASES_PER_TEST_SUITE];
} TstSte_T;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's not readable.

@khalimed
Copy link

khalimed commented Mar 9, 2020

@elbosch please finish review and give me sign when you are done so I can work on everything one time

@HansUweRempler HansUweRempler added this to the 04.20 milestone Mar 13, 2020
@elbosch elbosch self-requested a review March 16, 2020 16:38
Copy link
Contributor

@elbosch elbosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please respect our coding guidelines as much as possible.
Scope should be better maintained for some types and resources.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Epic: Continuous integration Verification and validation via automated testing: unit, integration and system Prio: High High priority issue (max prio level) Type: Feature User story, tasks/sub-tasks as markdown list inside an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants