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

Increase Developer Productivity and Code Qualit...

Vadim Klimov
September 27, 2023
20

Increase Developer Productivity and Code Quality of Custom Scripts in SAP Cloud Integration

Event: SAP Devtoberfest 2023
Date: September 27, 2023
Speaker: Vadim Klimov
Session: Increase developer productivity and code quality of custom scripts in SAP Cloud Integration

Vadim Klimov

September 27, 2023
Tweet

More Decks by Vadim Klimov

Transcript

  1. Devtoberfest 
 from SAP Increase developer productivity and code quality

    of custom scripts in SAP Cloud Integration Vadim Klimov 
 September 27, 2023
  2. 3 Developer Productivity Dependency management • Direct (first level) and

    transitive dependencies management • Dependency graph visualisation • Dependency caching • Multi-repository support Code editor / IDE • Code completion • Code templates • Code refactoring • Integration with development infrastructure • Extensibility Version control • Traceability of implemented changes • Ability to recover previous versions of a code base («time travelling» in a code repository) • Atomic changes • Branching and merging Coding assistant • Rapid code generation powered by AI technologies (not to be confused with code templates to generate boilerplate code) • Code generation from natural language comments and code fragments • Generated code snippets are coherent with existing code base • Many popular coding assistants offer extensive support for Java, but have limited or no support for Groovy, reducing accuracy and quality of generated code suggestions • Built-in web-based script editor in SAP Cloud Integration is for simple scripts development and minor code changes, not for complex developments
  3. 4 Code Quality Assurance Static code analysis Detect code weaknesses

    early. Verify compliance to development guidelines. Dynamic code analysis Analyze behaviour of a script at runtime. Dependency analysis Analyze dependencies used by a script. Performance analysis Analyze resources consumption by a script at runtime. Benchmark script execution.
  4. 5 Code Quality Assurance: Static Analysis Software composition analysis •

    Analysis of 3rd party open source dependencies, incl. transitive dependencies, for security vulnerabilities detection and license compliance • Commonly based on analysis of dependencies declared in Gradle or Maven build configuration scripts Static code analysis • Early detection of code weaknesses, incl. potential performance flaws and security vulnerabilities (Static Application Security Testing) • Enforcement of compliance with style guides, incl. naming conventions • Historic analysis and comparison with previous runs
  5. 6 Code Quality Assurance: Dynamic Analysis Performance analysis: (micro)benchmarking •

    Identify script performance by conducting precise method-level measurements Mutation testing • Detection of code mutations that are not captured by unit tests • Tools used in a Java ecosystem (e.g., PIT) are based on byte code mutations. This requires source code compilation, whereas scripts used in SAP Cloud Integration are not compiled pre- emptively Performance analysis: profiling • Detect performance bottlenecks or suboptimal use of resources such as CPU, memory, I/O Unit testing • Validate that changes introduced to a script behave as expected • Regression testing • Prefer declarative definition of unit tests • Historic analysis and comparison with previous runs • Integration of unit testing and code coverage tools • Inability to execute performance measurements on a worker node • Inaccuracy in reproducing runtime of a worker node in a local environment • Inaccuracy in emulating entire real-world workload processed by a worker node • Due to constraints that impact representativeness of measurements, results must be interpreted as relative, not absolute
  6. 7 Tools Code editors and IDEs IntelliJ IDEA, Eclipse, Visual

    Studio Code Coding assistants Codeium, GitHub Copilot, StarCoder Version control GitHub, GitLab, BitBucket, Azure Repos (a part of Azure DevOps), AWS CodeCommit (a part of AWS Developer Tools) Dependency management Gradle, Maven Static code analysis SonarQube (plugin uses CodeNarc), CodeNarc (standalone) Unit testing Spock, JUnit, TestNG Test coverage JaCoCo, Cobertura Mutation testing <No effective tools for Groovy> Software composition analysis Snyk, JFrog Xray Performance analysis: profiling SAP JVM Profiler, async-profiler, VisualVM, JConsole, Java Mission Control, JProfiler, YourKit Performance analysis: (micro)benchmarking Java Microbenchmark Harness (JMH), Google Caliper
  7. © 2023 SAP SE or an SAP affiliate company. All

    rights reserved. See Legal Notice on www.sap.com/legal-notice for use terms, disclaimers, disclosures, or restrictions related to SAP Materials for general audiences. Contact information: Vadim Klimov (he/him) Integration Architect https://www.linkedin.com/in/vadim-klimov Thank you