Wajdi Aljedaani

71 papers A* 4A 2C 1Journal 31Unranked 33
YearRankTypeTitle / Venue / Authors
2026 A* conf
WWW
Mingchen Li, Wajdi Aljedaani, Yingjie Liu, Navyasri Meka, Xuan Lu, Xinyue Ye, Junhua Ding, Yunhe Feng
2026 conf
SIGCSE (1)
Wajdi Aljedaani, P. D. Parthasarathy, Swaroop Joshi
2026 J jnl
Univers. Access Inf. Soc.
Isabel Francine Mendes, Wajdi Aljedaani, Marcelo Medeiros Eler
2026 conf
SIGCSE (1)
Wajdi Aljedaani, Marcelo Medeiros Eler, P. D. Parthasarathy, Will Witherspoon, Andrew Pamer
2026 conf
SIGCSE (1)
Wajdi Aljedaani, P. D. Parthasarathy
2026 conf
SIGCSE (1)
Wajdi Aljedaani, P. D. Parthasarathy, Xin Tong, Kyrie Zhixuan Zhou
2025 conf
SIGCSE (1)
Wajdi Aljedaani, P. D. Parthasarathy, Swaroop Joshi, Marcelo Medeiros Eler
2025 conf
INTERACT (1)
Alberto Dumont Alves Oliveira, Wajdi Aljedaani, Marcelo Medeiros Eler
2025 J jnl
Univers. Access Inf. Soc.
Wajdi Aljedaani, Rubel Hassan Mollik, Eysha Saad, Marcelo M. Eler, Asmaa Mansour Alghamdi
2025 conf
HCI (72)
Rana Ghoneim, Wajdi Aljedaani, Asmaa Mansour Alghamdi, Stephanie Ludi
2025 conf
SIGCSE (1)
Wajdi Aljedaani, Marcelo Medeiros Eler, P. D. Parthasarathy
2025 conf
HCI (84)
Hans Djalali, Wajdi Aljedaani, Asmaa Mansour Alghamdi, Stephanie Ludi, Marcelo Medeiros Eler
2025 J jnl
Univers. Access Inf. Soc.
Wajdi Aljedaani
2025 conf
W4A
Wajdi Aljedaani, Weston Leonard, Héctor Ruiz, Adrian Wegener
2025 A* conf
CHI
Marcelo Medeiros Eler, Wajdi Aljedaani
2025 conf
W4A
Wajdi Aljedaani, Ahmed Aljohani, Marcelo M. Eler, Abdulrahman Habib, Hyunsook Do
2025 J jnl
Softw.
Rubel Hassan Mollik, Arup Datta, Anamul Haque Mollah, Wajdi Aljedaani
2025 conf
SIGCSE (1)
Wajdi Aljedaani, P. D. Parthasarathy, Marcelo Medeiros Eler, Swaroop Joshi
2025 J jnl
Softw.
Hans Djalali, Wajdi Aljedaani, Stephanie Ludi
2025 conf
HCI (72)
Haifa Alshehri, Stephanie Ludi, Wajdi Aljedaani
2025 conf
HCI (84)
Hans Djalali, Wajdi Aljedaani, Stephanie Ludi
2025 J jnl
Univers. Access Inf. Soc.
Asmaa Mansour Alghamdi, Wajdi Aljedaani, Hamed Jalali, Stephanie Ludi, Marcelo M. Eler
2025 conf
W4A
Wajdi Aljedaani, Sijo Rejigeorge, Priya Jha, Srija Yadavalli, Manikanta Kothakota, Marcelo M. Eler, Abdulrahman Habib
2024 conf
W4A
Wajdi Aljedaani, Sandeep Kumar Rudhravaram, Akhila Chintham, Abdulrahman Habib, Marcelo M. Eler
2024 conf
W4A
Asmaa Mansour Alghamdi, Wajdi Aljedaani, Marcelo M. Eler, Stephanie Ludi
2024 conf
W4A
Wajdi Aljedaani, Marcelo M. Eler, Lorene E. Keeland, Hamed Jalali, Khaled Al-Raddah, Mohamed Wiem Mkaouer
2024 J jnl
Multim. Tools Appl.
Furqan Rustam, Muhammad Zahid Sharif, Wajdi Aljedaani, Ernesto Lee, Imran Ashraf
2024 conf
W4A
Wajdi Aljedaani, Uday Kiran Chimpiri, Durgasantosh Gaddam, Vaseem Ahammed Shaik, Yaswitha Karasala, Marcelo M. Eler
2024 J jnl
Int. J. Comput. Intell. Syst.
Punit Gupta, Furqan Rustam, Khadija Kanwal, Wajdi Aljedaani, Sultan Alfarhood, Mejdl S. Safran, Imran Ashraf
2024 conf
W4A
Wajdi Aljedaani, Abdulrahman Habib, Ahmed Aljohani, Marcelo Eler, Yunhe Feng
2024 A* conf
CHI
Wajdi Aljedaani, Mohamed Wiem Mkaouer, Marcelo Medeiros Eler, Marouane Kessentini
2024 J jnl
J. Braz. Comput. Soc.
Alberto Dumont Alves Oliveira, Paulo Sérgio Henrique Dos Santos, Wajdi Aljedaani, Marcelo Medeiros Eler
2024 J jnl
Comput. Networks
Furqan Rustam, Wajdi Aljedaani, Mahmoud Said Elsayed, Anca Delia Jurcut
2024 J jnl
Discov. Comput.
Furqan Rustam, Wajdi Aljedaani, Anca Delia Jurcut, Sultan Alfarhood, Mejdl S. Safran, Imran Ashraf
2024 conf
GAS
Wajdi Aljedaani, Anwar Ghammam, Mohamed Wiem Mkaouer, Marouane Kessentini
2024 J jnl
Multim. Tools Appl.
Hina Afzal, Furqan Rustam, Wajdi Aljedaani, Muhammad Abubakar Siddique, Saleem Ullah, Imran Ashraf
2024 conf
ITiCSE (1)
Anthony Peruma, Eman Abdullah AlOmar, Wajdi Aljedaani, Christian D. Newman, Mohamed Wiem Mkaouer
2024 J jnl
CoRR
Anthony Peruma, Eman Abdullah AlOmar, Wajdi Aljedaani, Christian D. Newman, Mohamed Wiem Mkaouer
2024 A conf
ICSME
James Ivers, Anwar Ghammam, Khouloud Gaaloul, Ipek Ozkaya, Marouane Kessentini, Wajdi Aljedaani
2024 J jnl
Int. J. Syst. Assur. Eng. Manag.
Montassar Ben Messaoud, Rania Ben Chekaya, Mohamed Wiem Mkaouer, Ilyes Jenhani, Wajdi Aljedaani
2024 conf
IHC
Luís André da Silveira, Wajdi Aljedaani, Marcelo Medeiros Eler
2024 J jnl
Comput.
Rana Ghoneim, Wajdi Aljedaani, Renée C. Bryce, Yasir Javed, Zafar Iqbal Khan
2023 J jnl
ACM Trans. Asian Low Resour. Lang. Inf. Process.
Muhammad Mujahid, Khadija Kanwal, Furqan Rustam, Wajdi Aljedaani, Imran Ashraf
2023 conf
SEET@ICSE
Wajdi Aljedaani, Mohamed Wiem Mkaouer, Anthony Peruma, Stephanie Ludi
2023 J jnl
CoRR
Wajdi Aljedaani, Mohamed Wiem Mkaouer, Anthony Peruma, Stephanie Ludi
2023 J jnl
IEEE Trans. Serv. Comput.
Anwar Ghammam, Thiago do Nascimento Ferreira, Wajdi Aljedaani, Marouane Kessentini, Ali Husain
2023 conf
IHC
Paulo Sérgio Henrique Dos Santos, Alberto Dumont Alves Oliveira, Thais Bonjorni Nobre De Jesus, Wajdi Aljedaani, Marcelo Medeiros Eler
2023 J jnl
Univers. Access Inf. Soc.
Wajdi Aljedaani, Rrezarta Krasniqi, Sanaa Aljedaani, Mohamed Wiem Mkaouer, Stephanie Ludi, Khaled Al-Raddah
2023 J jnl
IEEE Access
Rahman Shafique, Wajdi Aljedaani, Furqan Rustam, Ernesto Lee, Arif Mehmood, Gyu Sang Choi
2023 C conf
PST
Furqan Rustam, Anca Delia Jurcut, Wajdi Aljedaani, Imran Ashraf
2023 conf
ISEC
Wajdi Aljedaani, Mona Aljedaani, Mohamed Wiem Mkaouer, Stephanie Ludi
2023 conf
W4A
Wajdi Aljedaani, Mohammed Alkahtani, Stephanie Ludi, Mohamed Wiem Mkaouer, Marcelo Medeiros Eler, Marouane Kessentini, Ali Ouni
2022 J jnl
Soc. Netw. Anal. Min.
Ahmad M. Al-Shomar, Muhammad Al-Qurishi, Wajdi Aljedaani
2022 J jnl
Soc. Netw. Anal. Min.
Wajdi Aljedaani, Ibrahem Abuhaimed, Furqan Rustam, Mohamed Wiem Mkaouer, Ali Ouni, Ilyes Jenhani
2022 conf
HCI (46)
Obianuju Okafor, Wajdi Aljedaani, Stephanie Ludi
2022 J jnl
Neural Process. Lett.
Aashir Amaar, Wajdi Aljedaani, Furqan Rustam, Saleem Ullah, Vaibhav Rupapara, Stephanie Ludi
2022 J jnl
CoRR
Eman Abdullah AlOmar, Wajdi Aljedaani, Murtaza Tamjeed, Mohamed Wiem Mkaouer, Yasmine N. El-Glaly
2022 conf
W4A
Wajdi Aljedaani, Mohamed Wiem Mkaouer, Stephanie Ludi, Ali Ouni, Ilyes Jenhani
2022 J jnl
IEEE Access
Ernesto Lee, Furqan Rustam, Patrick Bernard Washington, Fatima El Barakaz, Wajdi Aljedaani, Imran Ashraf
2022 J jnl
Knowl. Based Syst.
Wajdi Aljedaani, Furqan Rustam, Mohamed Wiem Mkaouer, Abdullatif Ghallab, Vaibhav Rupapara, Patrick Bernard Washington, Ernesto Lee, Imran Ashraf
2022 J jnl
Multim. Tools Appl.
Muhammad Adeel Abid, Saleem Ullah, Muhammad Abubakar Siddique, Muhammad Faheem Mushtaq, Wajdi Aljedaani, Furqan Rustam
2021 A* conf
CHI
Eman Abdullah AlOmar, Wajdi Aljedaani, Murtaza Tamjeed, Mohamed Wiem Mkaouer, Yasmine N. El-Glaly
2021 conf
ASE Workshops
Wajdi Aljedaani, Furqan Rustam, Stephanie Ludi, Ali Ouni, Mohamed Wiem Mkaouer
2021 J jnl
Soft Comput.
Fan Fang, John Wu, Yanyan Li, Xin Ye, Wajdi Aljedaani, Mohamed Wiem Mkaouer
2021 J jnl
Soft Comput.
Xin Ye, Yongjie Zheng, Wajdi Aljedaani, Mohamed Wiem Mkaouer
2021 A conf
EASE
Wajdi Aljedaani, Anthony Peruma, Ahmed Aljohani, Mazen Alotaibi, Mohamed Wiem Mkaouer, Ali Ouni, Christian D. Newman, Abdullatif Ghallab, Stephanie Ludi
2021 J jnl
CoRR
Wajdi Aljedaani, Anthony Peruma, Ahmed Aljohani, Mazen Alotaibi, Mohamed Wiem Mkaouer, Ali Ouni, Christian D. Newman, Abdullatif Ghallab, Stephanie Ludi
2020 conf
ESSE
Wajdi Aljedaani, Yasir Javed, Mamdouh Alenezi
2020 J jnl
Appl. Soft Comput.
Bader Alkhazi, Andrew DiStasi, Wajdi Aljedaani, Hussein Alrubaye, Xin Ye, Mohamed Wiem Mkaouer
2020 conf
ICBDE
Wajdi Aljedaani, Yasir Javed, Mamdouh Alenezi
2019 conf
MOBILESoft@ICSE
Wajdi Aljedaani, Meiyappan Nagappan, Bram Adams, Michael W. Godfrey
tests/unit/test_decompile_similarity.py
← Index tests/unit/test_decompile_similarity.py python
"""Unit tests for similarity modules:
- bninja/similarity/minhashcustom.py
- bninja/similarity/minhasher.py
"""
import numpy as np
import pytest

from redb.extractors.decompiler.bninja.similarity.minhashcustom import MinHashCustom
from redb.extractors.decompiler.bninja.analysis.low_level_normalization import LowLevelNormalization


# ============================================================================
# 2a. MinHashCustom
# ============================================================================

class TestMinHashCustomInit:
    def test_init_empty(self):
        mh = MinHashCustom()
        assert not mh.hasMinHash()
        assert mh.minhash == b""
        assert mh.minhash_int == []

    def test_init_from_signature(self):
        sig = [10, 20, 30, 40]
        mh = MinHashCustom(minhash_signature=sig)
        assert mh.hasMinHash()
        assert mh.minhash_int == sig

    def test_init_from_bytes_uint32(self):
        """Verify round-trip: ints -> bytes -> MinHashCustom -> ints."""
        sig = [100, 200, 300]
        packed = np.array(sig, dtype=np.uint32).tobytes()
        # np.frombuffer returns numpy scalars; setMinHash does % 2**32 which
        # overflows numpy uint32, so verify the raw bytes round-trip instead.
        raw_arr = np.frombuffer(packed, dtype=np.uint32)
        assert list(raw_arr) == sig

    def test_init_from_bytes_uint8(self):
        """Verify round-trip: ints -> bytes -> back."""
        sig = [10, 20, 30]
        packed = np.array(sig, dtype=np.uint8).tobytes()
        raw_arr = np.frombuffer(packed, dtype=np.uint8)
        assert list(raw_arr) == sig

    def test_init_both_raises(self):
        sig = [1, 2, 3]
        packed = np.array(sig, dtype=np.uint32).tobytes()
        with pytest.raises(ValueError, match="only one"):
            MinHashCustom(minhash_bytes=packed, minhash_signature=sig)


class TestMinHashCustomSetGet:
    def test_set_and_get_minhash(self):
        mh = MinHashCustom()
        sig = [5, 10, 15]
        mh.setMinHash(sig)
        raw = mh.getMinHash()
        assert raw == np.array(sig, dtype=np.uint32).tobytes()
        assert mh.getMinHashInt() == sig

    def test_minhash_int_truncation(self):
        mh = MinHashCustom(minhash_bits=8)
        # Values > 256 should be truncated mod 2^8
        mh.setMinHash([300, 500, 256])
        for val in mh.minhash_int:
            assert 0 <= val < 256


class TestMinHashCustomHashData:
    def test_hash_data_string(self):
        result = MinHashCustom.hashData("hello", 42)
        assert isinstance(result, int)
        assert 0 <= result <= 0xFFFFFFFF

    def test_hash_data_bytes(self):
        result = MinHashCustom.hashData(b"bytes", 42)
        assert isinstance(result, int)
        assert 0 <= result <= 0xFFFFFFFF

    def test_hash_data_list(self):
        result = MinHashCustom.hashData([1, 2, 3], 42)
        assert isinstance(result, int)
        assert 0 <= result <= 0xFFFFFFFF

    def test_hash_data_unsupported_type(self):
        with pytest.raises(NotImplementedError, match="Type not supported"):
            MinHashCustom.hashData(123, 42)

    def test_hash_data_deterministic(self):
        assert MinHashCustom.hashData("test", 7) == MinHashCustom.hashData("test", 7)


class TestMinHashCustomScore:
    def test_score_identical(self):
        sig = [1, 2, 3, 4, 5]
        mh1 = MinHashCustom(minhash_signature=sig)
        mh2 = MinHashCustom(minhash_signature=sig)
        score = MinHashCustom.calculateMinHashScore(
            mh1.getMinHash(), mh2.getMinHash()
        )
        assert score == 100.0

    def test_score_different(self):
        mh1 = MinHashCustom(minhash_signature=[1, 2, 3, 4, 5])
        mh2 = MinHashCustom(minhash_signature=[6, 7, 8, 9, 10])
        score = MinHashCustom.calculateMinHashScore(
            mh1.getMinHash(), mh2.getMinHash()
        )
        assert score < 100.0

    def test_score_against(self):
        sig1 = [1, 2, 3, 4, 5]
        sig2 = [1, 2, 99, 4, 5]
        mh1 = MinHashCustom(minhash_signature=sig1)
        mh2 = MinHashCustom(minhash_signature=sig2)
        instance_score = mh1.scoreAgainst(mh2)
        static_score = MinHashCustom.calculateMinHashScore(
            mh1.getMinHash(), mh2.getMinHash()
        )
        assert instance_score == static_score


class TestMinHashCustomBitModes:
    def test_8bit_mode(self):
        mh = MinHashCustom(minhash_bits=8)
        mh.setMinHash([10, 20, 30])
        raw = mh.getMinHash()
        arr = np.frombuffer(raw, dtype=np.uint8)
        assert list(arr) == [10, 20, 30]

    def test_32bit_mode(self):
        mh = MinHashCustom(minhash_bits=32)
        mh.setMinHash([10, 20, 30])
        raw = mh.getMinHash()
        arr = np.frombuffer(raw, dtype=np.uint32)
        assert list(arr) == [10, 20, 30]


# ============================================================================
# 2b. MinHasher
# ============================================================================


class MockILNode:
    """Mock IL node with operation and operands for normalization."""
    def __init__(self, operation, operands=None):
        self.operation = operation
        self.operands = operands or []


class MockLLILBasicBlock:
    """Mock LLIL basic block that yields IL instructions."""
    def __init__(self, instructions):
        self._instructions = instructions

    def __iter__(self):
        return iter(self._instructions)


class MockLLILFunction:
    """Mock LLIL function with basic blocks."""
    def __init__(self, basic_blocks):
        self.basic_blocks = basic_blocks


# Import MinHasher after we know the module can handle the import
from redb.extractors.decompiler.bninja.similarity.minhasher import (
    MinHasher,
    MINHASH_SIGNATURE_LENGTH,
    MINHASH_SIGNATURE_BITS,
)


class TestMinHasherMakeNgrams:
    def setup_method(self):
        # Create a minimal minhasher with a mock LLIL function
        empty_func = MockLLILFunction([])
        self.hasher = MinHasher(seed=42, il_function=empty_func)

    def test_make_ngrams_basic(self):
        result = self.hasher.make_ngrams(["a", "b", "c", "d"], n=3)
        assert result == [("a", "b", "c"), ("b", "c", "d")]

    def test_make_ngrams_short_input(self):
        result = self.hasher.make_ngrams(["a", "b"], n=3)
        assert result == []

    def test_make_ngrams_exact_n(self):
        result = self.hasher.make_ngrams(["a", "b", "c"], n=3)
        assert result == [("a", "b", "c")]


class TestMinHasherCalculate:
    def _make_llil_function(self, num_instructions=10):
        """Create a mock LLIL function with enough instructions."""
        instructions = [
            MockILNode(operation=i % 20) for i in range(num_instructions)
        ]
        bb = MockLLILBasicBlock(instructions)
        return MockLLILFunction([bb])

    def test_calculate_minhash_empty_function(self):
        # Function with < 3 LLIL instructions -> empty list
        func = self._make_llil_function(num_instructions=2)
        hasher = MinHasher(seed=42, il_function=func)
        result = hasher.calculateMinHash()
        assert result == []

    def test_calculate_minhash_deterministic(self):
        func = self._make_llil_function(num_instructions=20)
        h1 = MinHasher(seed=42, il_function=func)
        h2 = MinHasher(seed=42, il_function=func)
        assert h1.calculateMinHash() == h2.calculateMinHash()

    def test_calculate_minhash_length(self):
        func = self._make_llil_function(num_instructions=20)
        hasher = MinHasher(seed=42, il_function=func)
        result = hasher.calculateMinHash()
        assert len(result) == MINHASH_SIGNATURE_LENGTH

    def test_calculate_minhash_value_range(self):
        func = self._make_llil_function(num_instructions=20)
        hasher = MinHasher(seed=42, il_function=func)
        result = hasher.calculateMinHash()
        for val in result:
            assert 0 <= val < 2 ** MINHASH_SIGNATURE_BITS

    def test_shingle_hash_deterministic(self):
        func = self._make_llil_function(num_instructions=5)
        hasher = MinHasher(seed=42, il_function=func)
        shingle = ([1, 2], [3, 4], [5, 6])
        assert hasher.shingle_hash(shingle, 99) == hasher.shingle_hash(shingle, 99)

    def test_seed_reproducibility(self):
        func = self._make_llil_function(num_instructions=20)
        h1 = MinHasher(seed=1, il_function=func)
        h2 = MinHasher(seed=2, il_function=func)
        r1 = h1.calculateMinHash()
        r2 = h2.calculateMinHash()
        # Different seeds should (very likely) produce different results
        assert r1 != r2