Coder Social home page Coder Social logo

st-6's Introduction

ST-6 Модульное тестирование на Java с использованием jUnit и Maven (2)

GitHub pull requests GitHub closed pull requests

Срок выполнения задания:

по 26.05.24 Relative date

Задание №1

В среде Intellij Idea создать проект Maven по шаблону quickstart. Убедиться в появлении веток java/main и java/test в разделе src проекта, а также файла с конфигурацией pom.xml в корне проекта.

Добавить в проект код программы org.st6.Program.java, содержащий реализацию игры "Крестики-Нолики" с использованием минимаксного алгоритма.

Далее, построить проект и убедиться, что приложение запускается без ошибок и работоспособно.

Задание №2

Добавить в проект модульные тесты, покрывающие основной функционал классов и методов. В этой работе упор делается не на качество самих тестов, а на их количество и процент покрытия исходного кода.

В pom.xml поместить зависимость пакета для генерации отчета по покрытию:

<build>
        <plugins>
            <!-- Code Coverage report generation -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.9</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>generate-code-coverage-report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

После запуска тестов найти в разделе target проекта ссылку на отчет (target/site/jacoco/index.html) и открыть его в браузере.

В данной работе необходимо добиться покрытия минимум 60% исходного кода. Скриншот отчета сохранить в файле report/coverage.png

Задание №3

Загрузить проект на GitHub и убедиться в работоспособности проекта через сценарии GH Actions.

st-6's People

Contributors

ashtanyuk avatar mineshadow7 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.