CtrlK
BlogDocsLog inGet started
Tessl Logo

giuseppe-trisciuoglio/developer-kit

Comprehensive developer toolkit providing reusable skills for Java/Spring Boot, TypeScript/NestJS/React/Next.js, Python, PHP, AWS CloudFormation, AI/RAG, DevOps, and more.

89

Quality

89%

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Risky

Do not use without reviewing

Overview
Quality
Evals
Security
Files

concurrent-testing.mdplugins/developer-kit-java/skills/unit-test-boundary-conditions/references/

Concurrent Boundary Testing Reference

Null and Race Conditions

import java.util.concurrent.*;

class ConcurrentBoundaryTest {

  @Test
  void shouldHandleNullInConcurrentMap() {
    ConcurrentHashMap<String, String> map = new ConcurrentHashMap<>();

    map.put("key", "value");
    assertThat(map.get("nonexistent")).isNull();
  }

  @Test
  void shouldHandleConcurrentModification() {
    List<Integer> list = new CopyOnWriteArrayList<>(List.of(1, 2, 3, 4, 5));

    for (int num : list) {
      if (num == 3) {
        list.add(6);
      }
    }

    assertThat(list).hasSize(6);
  }

  @Test
  void shouldHandleEmptyBlockingQueue() throws InterruptedException {
    BlockingQueue<String> queue = new LinkedBlockingQueue<>();

    assertThat(queue.poll()).isNull();
  }
}

Thread Safety Patterns

class ThreadSafetyBoundaryTest {

  @Test
  void shouldHandleAtomicOperations() {
    AtomicInteger counter = new AtomicInteger(0);

    counter.incrementAndGet();
    counter.addAndGet(Integer.MAX_VALUE);

    assertThat(counter.get()).isGreaterThan(0);
  }

  @Test
  void shouldHandleSynchronizedBlocks() {
    Object lock = new Object();
    int[] count = {0};

    synchronized (lock) {
      count[0]++;
    }

    assertThat(count[0]).isEqualTo(1);
  }
}

plugins

developer-kit-java

skills

unit-test-boundary-conditions

README.md

CHANGELOG.md

context7.json

CONTRIBUTING.md

README_CN.md

README_ES.md

README_IT.md

README.md

tessl.json

tile.json