DEV Community

Cover image for Ascoos OS: A Different Logic in Programming
Christos Drogidis
Christos Drogidis

Posted on

Ascoos OS: A Different Logic in Programming

In the world of software development, the “mainstream” is often presented as the only solution: PHPUnit for tests, CI/CD pipelines everywhere, frameworks that dictate your workflow. But Ascoos OS follows a different philosophy — it integrates testing, logging, and profiling directly into the runtime.


What Problem Does It Solve

  • Traditional testing tools (e.g., PHPUnit) require separate setup, configuration, and integration.
  • Testing is often treated as something “external” to the runtime.
  • This leads to more complexity and overhead.

With the TTestHandler class, Ascoos OS solves this problem: testing becomes part of the system itself, with a simple API that combines validation, logging, and execution timing.


Who Is It For

  • Developers who want quick and easy tests without external frameworks.
  • Teams that need runtime diagnostics and profiling in real time.
  • Open-source contributors who want to understand how Ascoos OS works and experiment with a different programming philosophy.

Example: TTestHandler + AscoosThrowException

Instead of relying on PHPUnit, we use the TTestHandler class to validate classes, objects, methods, and functions. At the same time, it logs results, measures execution time, and collects system statistics.

Additionally, Ascoos Exceptions produce multilingual UTF8 exception messages via the $AOS_ESTR table, ensuring error handling is localized and developer-friendly.

<?php
use ASCOOS\OS\Kernel\Tests\TTestHandler;
use ASCOOS\OS\Kernel\Core\TObject;
use ASCOOS\OS\Kernel\Core\DebugLevel;

global $AOS_LOGS_PATH;

// Configure properties
$properties = [
    'logs' => [
        'useLogger' => true,
        'dir' => $AOS_LOGS_PATH . '/',
        'file' => 'test_handler.log',
        'level' => DebugLevel::Info
    ],
    'lang' => 'en-US',
    'debug' => [
        'precision' => 4,
        'log_threshold' => DebugLevel::Info
    ]
];

// Initialize TTestHandler
$testHandler = new TTestHandler($properties);

// Initialize TObject
$object = new TObject();

// Check class existence
$testHandler->checkClass(TObject::class, true);

// Check object validity
$testHandler->checkObject($object, true);

// Check method availability
$testHandler->checkMethod($object, 'getClassMetadata', true);

// Execute AscoosThrowException with timing
$result = $testHandler->executeWithTiming(function () {
    AscoosThrowException(InvalidArgumentException::class, 100);
}, [], true);

print_r($result); 
// Logs exception, multilingual message, execution time, and system stats

// Free resources
$testHandler->Free();
$object->Free();
Enter fullscreen mode Exit fullscreen mode

Why It Matters

This approach makes testing part of the system itself. Instead of separating runtime and validation, Ascoos OS unifies them. The result: faster development, integrated diagnostics, and tools that reflect our philosophy of programming freedom.


Learn more at the official Ascoos OS website

Join the discussion: r/ascoos

Top comments (0)