TIP: Please make sure to read Getting started with programming tasks first.

Technical details for iOS with xcode support

Any xcode project might be used as a programming task. You can use any testing framework supported by xcode, this sample project uses --- for running unit tests.

xcode build will be executed with following command:

xcode clean test

Automatic assessment

It is possible to automatically assess solution posted by the candidate. Automatic assessment is based on Unit Tests results and Code Quality measurements.

All unit tests that are executed during the build will be detected by the Devskiller platform.

There are two kinds of unit tests:

  1. Candidate tests - unit tests that are visible for the candidate during the test. Should be used to do only the basic verification and help the candidate to understand the requirements. Candidate tests WILL NOT be used to calculate the final score.
  2. Verification tests - unit tests that are hidden from the candidate during the test. Files containing verification tests will be added to the project after the candidate finishes the test and will be executed during verification phase. Verification tests result will be used to calculate the final score.

After candidate finishes the test, our platform builds the project posted by the candidate and executes verification tests and static code analysis.

Devskiller project descriptor

Programming task can be configured with the Devskiller project descriptor file. Just create a devskiller.json file and place it in the root directory of your project. Here is an example project descriptor:

{
  "readOnlyFiles" : ["gradlew", "gradlew.bat"],
  "verification" : {
    "testNamePatterns" : [".*verify_pack.*"],
    "pathPatterns" : ["**src/test/**/verify_pack**"]
  }
}

You can find more details about devskiller.json descriptor in our documentation

Automatic verification with verification tests

To enable automatic verification of candidates' solution, you need to define which tests should be treated as verification tests.

All files classified as verification tests will be removed from a project prepared for the candidate.

To define verification tests, you need to set two configuration properties in devskiller.json project descriptor:

  • testNamePatterns  - an array of RegEx patterns which should match all the test names of verification tests. Test name contains: [package_name].[Class_name].[method_name]. In our sample project all verification tests are in verify_packpackage, so the following pattern will be sufficient:
"testNamePatterns" : [".*verify_pack.*"]
  • pathPatterns - an array of GLOB patterns which should match all the files containing verification tests. All the files that match defined patterns will be deleted from candidates' projects and will be added to the projects during the verification phase.
"pathPatterns" : ["**src/test/**/verify_pack**"]

Note: You might want to overwrite the project.pbxproj  files during the verification phase as the package with verification tests (and new files) is then added to the project. It can be done in the following way.

{
    "readOnlyFiles" : ["NetworkTask.xcodeproj/project.pbxproj"],
    "verification" : {
    "testNamePatterns" : [".*VerifyTest.*"],
    "pathPatterns" : ["**NetworkTaskTests/verify_pack**"],
    "overwrite" : {
            "NetworkTaskTests/verify_pack/project_verif":   "NetworkTask.xcodeproj/project.pbxproj"
        }
}
}


Note: If you are going to use the overwrite functionality, you should make sure you set the files that you are overwriting as read-only (as in the example above), so that the candidates don't try to introduce changes that will later be overwritten. Also, in such cases, you might want to add information to task readme and description so that the candidates don't add new files to the project and try to modify
project.pbxproj  file.

Did this answer your question?