Olivier H. Roux

112 papers A* 1A 3B 17C 7Misc 1Journal 45Unranked 35
YearRankTypeTitle / Venue / Authors
2026 J jnl
Discret. Event Dyn. Syst.
Jan Komenda, Dimitri Lefebvre, Olivier H. Roux
2026 J jnl
Discret. Event Dyn. Syst.
Jan Komenda, Sébastien Lahaye, Rémi Parrot, Olivier H. Roux
2025 B conf
Petri Nets
Didier Lime, Rémi Parrot, Olivier H. Roux
2025 J jnl
Cybern. Syst.
Imane Haur, Jean-Luc Béchennec, Olivier H. Roux
2025 Misc conf
SAC
Étienne André, Jean-Luc Béchennec, Sudipta Chattopadhyay, Sébastien Faucou, Didier Lime, Dylan Marinho, Olivier H. Roux, Jun Sun
2024 conf
QEST+FORMATS
Loriane Leclercq, Didier Lime, Olivier H. Roux
2023 B conf
Petri Nets
Loriane Leclercq, Didier Lime, Olivier H. Roux
2023 J jnl
Discret. Event Dyn. Syst.
Antoine Bernabeu, Jean-Luc Béchennec, Mikaël Briday, Sébastien Faucou, Olivier H. Roux
2023 J jnl
CoRR
Étienne André, Didier Lime, Olivier H. Roux
2023 J jnl
Discret. Event Dyn. Syst.
Rémi Parrot, Mikaël Briday, Olivier H. Roux
2023 J jnl
Softw. Qual. J.
Imane Haur, Jean-Luc Béchennec, Olivier H. Roux
2023 conf
FORMATS
Anthony Spriet, Didier Lime, Olivier H. Roux
2022 J jnl
IEEE Trans. Autom. Control.
Aleksandra Jovanovic, Didier Lime, Olivier H. Roux
2022 C conf
ICFEM
Imane Haur, Jean-Luc Béchennec, Olivier H. Roux
2022 C conf
CoDIT
Imane Haur, Jean-Luc Béchennec, Olivier H. Roux
2022 J jnl
Log. Methods Comput. Sci.
Étienne André, Didier Lime, Olivier H. Roux
2021 B conf
Petri Nets
Serge Haddad, Didier Lime, Olivier H. Roux
2021 J jnl
CoRR
Didier Lime, Olivier H. Roux, Charlotte Seidner
2021 J jnl
Fundam. Informaticae
Didier Lime, Olivier H. Roux, Charlotte Seidner
2021 J jnl
Discret. Event Dyn. Syst.
Jean-Luc Béchennec, Didier Lime, Olivier H. Roux
2021 C conf
ARITH
Rémi Parrot, Mikaël Briday, Olivier H. Roux
2021 B conf
Petri Nets
Rémi Parrot, Mikaël Briday, Olivier H. Roux
2020 J jnl
CoRR
Étienne André, Didier Lime, Olivier H. Roux
2019 J jnl
Int. J. Control
Aleksandra Jovanovic, Didier Lime, Olivier H. Roux
2019 conf
ACSD
Jean-Luc Béchennec, Didier Lime, Olivier H. Roux
2019 B conf
Petri Nets
Didier Lime, Olivier H. Roux, Charlotte Seidner
2019 J jnl
Fundam. Informaticae
Victor Khomenko, Jetty Kleijn, Wojciech Penczek, Olivier H. Roux
2018 conf
ITSC
Yrvann Emzivat, Javier Ibañez-Guzmán, Herve Illy, Philippe Martinet, Olivier H. Roux
2018 J jnl
CoRR
Xinwei Chai, Morgan Magnin, Olivier H. Roux
2018 B ed.
Petri Nets
Victor Khomenko, Olivier H. Roux
2018 conf
ACSD
Hanifa Boucheneb, Didier Lime, Olivier H. Roux, Charlotte Seidner
2018 C conf
LATA
Thomas Chatain, Maurice Comlan, David Delfieu, Loïg Jezequel, Olivier H. Roux
2018 J jnl
IEEE Des. Test
Jean-Luc Béchennec, Sébastien Faucou, Olivier H. Roux, Matthias Brun, Louis-Marie Givel
2017 conf
ITSC
Yrvann Emzivat, Javier Ibañez-Guzmán, Philippe Martinet, Olivier H. Roux
2017 B conf
CONCUR
Nicolas David, Claude Jard, Didier Lime, Olivier H. Roux
2017 B conf
Intelligent Vehicles Symposium
Yrvann Emzivat, Javier Ibañez-Guzmán, Philippe Martinet, Olivier H. Roux
2017 J jnl
Algorithms
Emna Ben Abdallah, Tony Ribeiro, Morgan Magnin, Olivier H. Roux, Katsumi Inoue
2017 conf
FORMATS
Hanifa Boucheneb, Didier Lime, Baptiste Parquier, Olivier H. Roux, Charlotte Seidner
2017 J jnl
Computing
Nicolas Beldiceanu, Barbara Dumas Feris, Philippe Gravey, Md Sabbir Hasan, Claude Jard, Thomas Ledoux, Yunbo Li, Didier Lime, Gilles Madi-Wamba, Jean-Marc Menaud, Pascal Morel, Michel Morvan, Marie-Laure Moulinard, Anne-Cécile Orgerie, Jean-Louis Pazat, Olivier H. Roux, Ammar Sharaiha
2016 conf
FTSCS
Baptiste Parquier, Laurent Rioux, Rafik Henia, Romain Soulat, Olivier H. Roux, Didier Lime, Étienne André
2016 C conf
ICFEM
Étienne André, Didier Lime, Olivier H. Roux
2016 conf
FORMATS
Étienne André, Didier Lime, Olivier H. Roux
2016 J jnl
Discret. Event Dyn. Syst.
Johan Girault, Jean Jacques Loiseau, Olivier H. Roux
2016 B conf
Petri Nets
Yrvann Emzivat, Benoît Delahaye, Didier Lime, Olivier H. Roux
2016 conf
SIES
Louis-Marie Givel, Jean-Luc Béchennec, Matthias Brun, Sébastien Faucou, Olivier H. Roux
2015 J jnl
Int. J. Control
Gilles Benattar, Franck Cassez, Didier Lime, Olivier H. Roux
2015 conf
SynCoP
Nicolas David, Claude Jard, Didier Lime, Olivier H. Roux
2015 B conf
Petri Nets
Nicolas David, Claude Jard, Didier Lime, Olivier H. Roux
2015 J jnl
IEEE Trans. Software Eng.
Aleksandra Jovanovic, Didier Lime, Olivier H. Roux
2015 conf
RP
Étienne André, Didier Lime, Olivier H. Roux
2015 J jnl
Entropy
Francisco Chinesta, Morgan Magnin, Olivier H. Roux, Amine Ammar, Elías Cueto
2015 conf
SMARTGREENS
Nicolas Beldiceanu, Barbara Dumas Feris, Philippe Gravey, Md Sabbir Hasan, Claude Jard, Thomas Ledoux, Yunbo Li, Didier Lime, Gilles Madi-Wamba, Jean-Marc Menaud, Pascal Morel, Michel Morvan, Marie-Laure Moulinard, Anne-Cécile Orgerie, Jean-Louis Pazat, Olivier H. Roux, Ammar Sharaiha
2015 conf
HPCC/CSS/ICESS
Louis-Marie Givel, Matthias Brun, Camille Constant, Sébastien Faucou, Olivier H. Roux
2014 J jnl
Fundam. Informaticae
Claude Jard, Didier Lime, Olivier H. Roux
2014 C conf
SIMULTECH
Julien Tanguy, Jean-Luc Béchennec, Mikaël Briday, Olivier H. Roux
2013 book
Claude Jard, Olivier H. Roux
2013 C conf
ETFA
Julien Tanguy, Jean-Luc Béchennec, Mikaël Briday, Sebastien Dube, Olivier H. Roux
2013 A conf
TACAS
Aleksandra Jovanovic, Didier Lime, Olivier H. Roux
2013 ch.
Communicating Embedded Systems
Didier Lime, Olivier H. Roux, Jirí Srba
2013 B conf
Petri Nets
Hanifa Boucheneb, Didier Lime, Olivier H. Roux
2013 J jnl
Discret. Event Dyn. Syst.
Didier Lime, Claude Martinez, Olivier H. Roux
2013 J jnl
Formal Methods Syst. Des.
Claude Jard, Didier Lime, Olivier H. Roux, Louis-Marie Traonouez
2013 B conf
ATVA
Aleksandra Jovanovic, Didier Lime, Olivier H. Roux
2013 J jnl
Theor. Comput. Sci.
Béatrice Bérard, Franck Cassez, Serge Haddad, Didier Lime, Olivier H. Roux
2013 ch.
Communicating Embedded Systems
Alexandre David, Gerd Behrmann, Peter E. Bulychev, Joakim Byg, Thomas Chatain, Kim G. Larsen, Paul Pettersson, Jacob Illum Rasmussen, Jirí Srba, Wang Yi, Kenneth Yrke Jørgensen, Didier Lime, Morgan Magnin, Olivier H. Roux, Louis-Marie Traonouez
2012 J jnl
Int. J. Found. Comput. Sci.
Gilles Benattar, Béatrice Bérard, Didier Lime, John Mullins, Olivier H. Roux, Mathieu Sassolas
2012 conf
CS&P
Didier Lime, Olivier H. Roux, Claude Jard
2012 J jnl
CoRR
Gilles Benattar, Franck Cassez, Didier Lime, Olivier H. Roux
2012 conf
WODES
Hanifa Boucheneb, Adrien Bullich, Olivier H. Roux
2012 conf
ICEIS (2)
Cédrick Lelionnais, Matthias Brun, Jérôme Delatour, Olivier H. Roux, Charlotte Seidner
2012 conf
WODES
Aleksandra Jovanovic, Sébastien Faucou, Didier Lime, Olivier H. Roux
2012 conf
FORMATS
S. Akshay, Loïc Hélouët, Claude Jard, Didier Lime, Olivier H. Roux
2011 conf
AFL
Gilles Benattar, Béatrice Bérard, Didier Lime, John Mullins, Olivier H. Roux, Mathieu Sassolas
2011 J jnl
Discret. Event Dyn. Syst.
Claude Martinez, Olivier H. Roux
2010 conf
FORMATS
Bartosz Grabiec, Louis-Marie Traonouez, Claude Jard, Didier Lime, Olivier H. Roux
2010 B conf
ATVA
Louis-Marie Traonouez, Bartosz Grabiec, Claude Jard, Didier Lime, Olivier H. Roux
2009 J jnl
Fundam. Informaticae
Morgan Magnin, Pierre Molinaro, Olivier H. Roux
2009 J jnl
Fundam. Informaticae
Morgan Magnin, Pierre Molinaro, Olivier H. Roux
2009 J jnl
Real Time Syst.
Didier Lime, Olivier H. Roux
2009 conf
BICoB
Mylène Maurin, Morgan Magnin, Olivier H. Roux
2009 J jnl
J. Univers. Comput. Sci.
Louis-Marie Traonouez, Didier Lime, Olivier H. Roux
2009 A conf
TACAS
Didier Lime, Olivier H. Roux, Charlotte Seidner, Louis-Marie Traonouez
2009 conf
FORMATS
Gilles Benattar, Franck Cassez, Didier Lime, Olivier H. Roux
2009 J jnl
J. Log. Comput.
Hanifa Boucheneb, Guillaume Gardey, Olivier H. Roux
2009 conf
ACSD
Hind Rakkay, Hanifa Boucheneb, Olivier H. Roux
2008 B conf
ICECCS
Dominique Bertrand, Anne-Marie Déplanche, Sébastien Faucou, Olivier H. Roux
2008 J jnl
IEEE Trans. Ind. Informatics
Charlotte Seidner, Olivier H. Roux
2008 J jnl
Fundam. Informaticae
Marc Boyer, Olivier H. Roux
2008 conf
FORMATS
Louis-Marie Traonouez, Didier Lime, Olivier H. Roux
2008 B conf
Petri Nets
Morgan Magnin, Didier Lime, Olivier H. Roux
2008 J jnl
Theor. Comput. Sci.
Béatrice Bérard, Franck Cassez, Serge Haddad, Didier Lime, Olivier H. Roux
2007 conf
ICATPN
Marc Boyer, Olivier H. Roux
2007 J jnl
Discret. Event Dyn. Syst.
Bernard Berthomieu, Didier Lime, Olivier H. Roux, François Vernadat
2006 J jnl
Discret. Event Dyn. Syst.
Didier Lime, Olivier H. Roux
2006 J jnl
Theory Pract. Log. Program.
Guillaume Gardey, Olivier H. Roux, Olivier F. Roux
2006 J jnl
J. Syst. Softw.
Franck Cassez, Olivier H. Roux
2006 J jnl
Tech. Sci. Informatiques
Didier Lime, Olivier H. Roux
2005 conf
SoftMC@CAV
Morgan Magnin, Didier Lime, Olivier H. Roux
2005 B conf
ATVA
Béatrice Bérard, Franck Cassez, Serge Haddad, Didier Lime, Olivier H. Roux
2005 conf
FORMATS
Béatrice Bérard, Franck Cassez, Serge Haddad, Didier Lime, Olivier H. Roux
2005 conf
SecCO@CONCUR
Guillaume Gardey, John Mullins, Olivier H. Roux
2005 A* conf
CAV
Guillaume Gardey, Didier Lime, Morgan Magnin, Olivier H. Roux
2005 J jnl
CoRR
Guillaume Gardey, Olivier H. Roux, Olivier F. Roux
2005 conf
FSTTCS
Béatrice Bérard, Franck Cassez, Serge Haddad, Didier Lime, Olivier H. Roux
2004 J jnl
Fundam. Informaticae
Franck Cassez, Claire Pagetti, Olivier H. Roux
2004 A conf
RTSS
Didier Lime, Olivier H. Roux
2004 conf
AVoCS
Franck Cassez, Olivier H. Roux
2004 conf
ICATPN
Olivier H. Roux, Didier Lime
2003 conf
PNPM
Didier Lime, Olivier H. Roux
2003 conf
FORMATS
Guillaume Gardey, Olivier H. Roux, Olivier F. Roux
2001 conf
ETFA (2)
Olivier H. Roux, David Delfieu, Pierre Molinaro
1993 B conf
SAFECOMP
Pierre Molinaro, Olivier H. Roux
tests/unit/test_apk_cfg_features.py
← Index tests/unit/test_apk_cfg_features.py python
"""
Unit tests for APK CFG feature parity with the Binary Ninja pipeline.

Tests advanced CFG features computed from smali (topology hash, MD-index,
WL-MinHash, prime product, packed adjacency, block features export) and
the slimmed similarity table.

All tests use mocked smali input — no JADX/apktool/Java required.
"""
import pytest

from redb.extractors.decompiler.apk.smali_cfg import (
    SmaliCFGMetrics,
    compute_cfg_metrics,
)
from redb.extractors.decompiler.apk.method_extractor import (
    SMALI_OP_PRIMES,
    compute_prime_product_smali,
    count_call_instructions,
)

pytestmark = [pytest.mark.unit, pytest.mark.apk, pytest.mark.decompile]


# ===================================================================
# Sample smali bodies for testing
# ===================================================================

# Simple linear method: 3 instructions, 1 block
SMALI_LINEAR = """\
    const/4 v0, 0x0
    invoke-virtual {p0, v0}, Lcom/Foo;->bar(I)V
    return-void
"""

# Diamond CFG: if-else with two paths merging
SMALI_DIAMOND = """\
    const/4 v0, 0x1
    if-eqz v0, :cond_0
    invoke-virtual {p0}, Lcom/Foo;->pathA()V
    goto :goto_0
    :cond_0
    invoke-virtual {p0}, Lcom/Foo;->pathB()V
    :goto_0
    return-void
"""

# Loop: a back edge from goto to a label before it
SMALI_LOOP = """\
    const/4 v0, 0x0
    :loop_start
    add-int/lit8 v0, v0, 0x1
    if-lt v0, v1, :loop_start
    return-void
"""

# Multi-block with several invoke calls
SMALI_MULTI_CALL = """\
    invoke-virtual {p0}, Lcom/Foo;->a()V
    invoke-static {v0}, Lcom/Bar;->b(I)V
    invoke-direct {p0, v1}, Lcom/Baz;-><init>(I)V
    const/4 v0, 0x0
    return-void
"""


# ===================================================================
# TestSmaliCFGMetricsAdvanced — new fields in SmaliCFGMetrics
# ===================================================================

class TestSmaliCFGMetricsAdvanced:
    """Test that advanced CFG fields are populated by compute_cfg_metrics."""

    def test_topology_hash_is_bytes(self):
        m = compute_cfg_metrics(SMALI_DIAMOND)
        assert isinstance(m.cfg_topology_hash, bytes)
        assert len(m.cfg_topology_hash) == 16

    def test_topology_hash_nonzero_for_multiblock(self):
        m = compute_cfg_metrics(SMALI_DIAMOND)
        assert m.cfg_topology_hash != b'\x00' * 16

    def test_topology_hash_zero_for_empty(self):
        m = compute_cfg_metrics("")
        assert m.cfg_topology_hash == b'\x00' * 16

    def test_identical_cfg_same_topology_hash(self):
        """Two smali methods with the same CFG structure produce the same hash."""
        smali_a = """\
    const/4 v0, 0x1
    if-eqz v0, :cond_0
    const/4 v1, 0x2
    goto :goto_0
    :cond_0
    const/4 v1, 0x3
    :goto_0
    return-void
"""
        smali_b = """\
    const/4 v5, 0x9
    if-nez v5, :cond_0
    add-int v6, v5, v5
    goto :goto_0
    :cond_0
    sub-int v6, v5, v5
    :goto_0
    return-void
"""
        m_a = compute_cfg_metrics(smali_a)
        m_b = compute_cfg_metrics(smali_b)
        assert m_a.cfg_topology_hash == m_b.cfg_topology_hash

    def test_different_cfg_different_topology_hash(self):
        m_linear = compute_cfg_metrics(SMALI_LINEAR)
        m_diamond = compute_cfg_metrics(SMALI_DIAMOND)
        assert m_linear.cfg_topology_hash != m_diamond.cfg_topology_hash

    def test_md_index_topdown_nonzero(self):
        m = compute_cfg_metrics(SMALI_DIAMOND)
        assert m.md_index_topdown != 0

    def test_md_index_bottomup_nonzero(self):
        m = compute_cfg_metrics(SMALI_DIAMOND)
        assert m.md_index_bottomup != 0

    def test_md_index_zero_for_empty(self):
        m = compute_cfg_metrics("")
        assert m.md_index_topdown == 0
        assert m.md_index_bottomup == 0

    def test_wl_minhash_length(self):
        m = compute_cfg_metrics(SMALI_DIAMOND)
        assert len(m.wl_minhash) == 128

    def test_wl_minhash_sentinel_for_empty(self):
        m = compute_cfg_metrics("")
        assert m.wl_minhash == [255] * 128

    def test_wl_minhash_values_are_uint8(self):
        m = compute_cfg_metrics(SMALI_DIAMOND)
        for val in m.wl_minhash:
            assert 0 <= val <= 255

    def test_cfg_adjacency_nonempty_for_multiblock(self):
        m = compute_cfg_metrics(SMALI_DIAMOND)
        assert len(m.cfg_adjacency) > 0

    def test_cfg_adjacency_empty_for_empty(self):
        m = compute_cfg_metrics("")
        assert m.cfg_adjacency == []

    def test_cfg_adjacency_packed_format(self):
        """Each entry should be (src << 16) | tgt."""
        m = compute_cfg_metrics(SMALI_DIAMOND)
        for edge in m.cfg_adjacency:
            assert isinstance(edge, int)
            src = edge >> 16
            tgt = edge & 0xFFFF
            assert src < m.block_count
            assert tgt < m.block_count

    def test_block_features_exported(self):
        m = compute_cfg_metrics(SMALI_DIAMOND)
        assert len(m.block_features) == m.block_count
        for bf in m.block_features:
            assert len(bf) == 8  # 7 categories + successor_count

    def test_cfg_feature_tlsh_none_for_small(self):
        """Small methods produce None (< 50 bytes of feature data)."""
        m = compute_cfg_metrics(SMALI_LINEAR)
        # Single-block linear method — too small for TLSH
        assert m.cfg_feature_tlsh is None

    def test_loop_count_with_back_edge(self):
        m = compute_cfg_metrics(SMALI_LOOP)
        assert m.loop_count >= 1


# ===================================================================
# TestPrimeProductSmali
# ===================================================================

class TestPrimeProductSmali:

    def test_empty_returns_zero(self):
        assert compute_prime_product_smali("") == 0

    def test_none_returns_zero(self):
        assert compute_prime_product_smali(None) == 0

    def test_known_computation(self):
        """Single invoke instruction → CALL category → prime 17."""
        smali = "    invoke-virtual {p0}, Lcom/Foo;->bar()V"
        assert compute_prime_product_smali(smali) == 17

    def test_two_instructions(self):
        """const (CONST→2) * invoke (CALL→17) = 34."""
        smali = """\
    const/4 v0, 0x0
    invoke-virtual {p0, v0}, Lcom/Foo;->bar(I)V
"""
        assert compute_prime_product_smali(smali) == 2 * 17

    def test_skips_directives_and_labels(self):
        """Directives, labels, and comments should be skipped."""
        smali = """\
.registers 2
.line 10
    :label
    # comment
    const/4 v0, 0x0
"""
        # Only const/4 → CONST → prime 2
        assert compute_prime_product_smali(smali) == 2

    def test_position_independent(self):
        """Reordering instructions produces the same product (multiplication is commutative)."""
        smali_a = """\
    add-int v0, v1, v2
    invoke-virtual {p0}, Lcom/Foo;->bar()V
"""
        smali_b = """\
    invoke-virtual {p0}, Lcom/Foo;->bar()V
    add-int v0, v1, v2
"""
        assert compute_prime_product_smali(smali_a) == compute_prime_product_smali(smali_b)

    def test_all_categories_have_primes(self):
        """Every category in SMALI_OP_PRIMES is a positive integer."""
        for cat, prime in SMALI_OP_PRIMES.items():
            assert isinstance(prime, int)
            assert prime >= 1

    def test_mod_2_64(self):
        """Result should be mod 2^64 (doesn't overflow)."""
        # A very long method — product stays within uint64
        smali = "\n".join(["    mul-int v0, v1, v2"] * 1000)
        result = compute_prime_product_smali(smali)
        assert 0 <= result < 2**64


# ===================================================================
# TestCallCount
# ===================================================================

class TestCallCount:

    def test_empty(self):
        assert count_call_instructions("") == 0

    def test_none(self):
        assert count_call_instructions(None) == 0

    def test_single_invoke(self):
        smali = "    invoke-virtual {p0}, Lcom/Foo;->bar()V"
        assert count_call_instructions(smali) == 1

    def test_multiple_invoke_types(self):
        assert count_call_instructions(SMALI_MULTI_CALL) == 3

    def test_non_invoke_not_counted(self):
        smali = """\
    const/4 v0, 0x0
    add-int v1, v0, v0
    return-void
"""
        assert count_call_instructions(smali) == 0


# ===================================================================
# TestSimilarityTableSlimmed
# ===================================================================

class TestSimilarityTableSlimmed:
    """Verify the similarity table no longer contains moved fields."""

    def test_export_similarity_no_block_count(self):
        """block_count should not be in similarity export columns."""
        from redb.extractors.decompiler.DecompileAPK import DecompileAPK
        from unittest.mock import MagicMock

        extractor = DecompileAPK.__new__(DecompileAPK)
        extractor.log = MagicMock()
        extractor.sha256 = "a" * 64
        extractor.sha1 = "b" * 40
        extractor.md5 = "c" * 32
        extractor.analysis_results = {
            "sha256": "a" * 64,
            "sha1": "b" * 40,
            "md5": "c" * 32,
            "similarity_metrics": [{
                "smali_method_hash": "d" * 64,
                "cyclomatic_complexity": 3,
                "ssdeep_smali": None,
                "tlsh_smali": None,
                "minhash": [1, 2, 3],
            }],
        }

        export = extractor.prepare_export_data("ClickHouseExporter")
        sim_cols = export["method_similarity_metrics"]["column_names"]
        assert "block_count" not in sim_cols
        assert "edge_count" not in sim_cols
        assert "loop_count" not in sim_cols
        assert "max_depth" not in sim_cols
        assert "max_fan_out" not in sim_cols
        # These should still be there
        assert "smali_method_hash" in sim_cols
        assert "ssdeep_smali" in sim_cols
        assert "minhash" in sim_cols
        # cyclomatic_complexity moved to cfg table
        assert "cyclomatic_complexity" not in sim_cols


# ===================================================================
# TestCFGTableExport
# ===================================================================

class TestCFGTableExport:
    """Verify the new CFG table is exported correctly."""

    def test_export_cfg_table_present(self):
        from redb.extractors.decompiler.DecompileAPK import DecompileAPK
        from unittest.mock import MagicMock

        extractor = DecompileAPK.__new__(DecompileAPK)
        extractor.log = MagicMock()
        extractor.analysis_results = {
            "sha256": "a" * 64,
            "sha1": "b" * 40,
            "md5": "c" * 32,
            "cfg": [{
                "smali_method_hash": "d" * 64,
                "cfg_topology_hash": b'\x01' * 16,
                "block_count": 4,
                "edge_count": 5,
                "instructions_count": 20,
                "call_count": 3,
                "cyclomatic_complexity": 3,
                "loop_count": 1,
                "max_depth": 2,
                "max_fan_out": 2,
                "md_index_topdown": 12345,
                "md_index_bottomup": 67890,
                "prime_product_smali": 999,
                "cfg_feature_tlsh": None,
                "wl_minhash": [0] * 128,
                "bb_features": [[10, 1, 0, 2, 1, 0, 0, 2]] * 4,
                "cfg_adjacency": [0x00010000, 0x00010002],
            }],
        }

        export = extractor.prepare_export_data("ClickHouseExporter")
        assert "cfg_methods" in export
        cfg_export = export["cfg_methods"]
        assert cfg_export["table"] == "code_apk_cfg_methods"
        assert len(cfg_export["data"]) == 1
        assert "cfg_topology_hash" in cfg_export["column_names"]
        assert "prime_product_smali" in cfg_export["column_names"]
        assert "wl_minhash" in cfg_export["column_names"]
        assert "bb_features" in cfg_export["column_names"]
        assert "cfg_adjacency" in cfg_export["column_names"]
        # Verify column count matches data width
        assert len(cfg_export["column_names"]) == len(cfg_export["data"][0])
        assert len(cfg_export["column_type_names"]) == len(cfg_export["data"][0])